Module: Mongoid::Criteria::Queryable::Selectable
- Defined in:
- lib/locomotive/mongoid/patches.rb
Instance Method Summary collapse
Instance Method Details
#selection(criterion = nil) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/locomotive/mongoid/patches.rb', line 29 def selection(criterion = nil) clone.tap do |query| if criterion criterion.each_pair do |field, value| _field = field.is_a?(Key) || field.is_a?(Origin::Key) ? field : field.to_s yield(query.selector, _field, value) end end query.reset_strategies! end end |