Method: Mongoid::Criteria::Findable#for_ids
- Defined in:
- lib/mongoid/criteria/findable.rb
#for_ids(ids) ⇒ Criteria
Adds a criterion to the Criteria that specifies an id that must be matched.
60 61 62 63 64 65 66 67 |
# File 'lib/mongoid/criteria/findable.rb', line 60 def for_ids(ids) ids = mongoize_ids(ids) if ids.size > 1 send(id_finder, { _id: { "$in" => ids }}) else send(id_finder, { _id: ids.first }) end end |