Method: Mongoid::Extensions::Hash::CriteriaHelpers#extract_id
- Defined in:
- lib/mongoid/extensions/hash/criteria_helpers.rb
#extract_id ⇒ Object
Get the id attribute from this hash, whether it’s prefixed with an underscore or is a symbol.
41 42 43 |
# File 'lib/mongoid/extensions/hash/criteria_helpers.rb', line 41 def extract_id self["id"] || self["_id"] || self[:id] || self[:_id] end |