Module: Mongoid::Criteria::Queryable::Extensions::Range::ClassMethods
- Defined in:
- lib/mongoid/criteria/queryable/extensions/range.rb
Instance Method Summary collapse
-
#evolve(object) ⇒ Hash
Evolve the range.
Instance Method Details
#evolve(object) ⇒ Hash
Evolve the range. This will transform it into a $gte/$lte selection.
58 59 60 61 |
# File 'lib/mongoid/criteria/queryable/extensions/range.rb', line 58 def evolve(object) return object unless object.is_a?(::Range) { "$gte" => object.min, "$lte" => object.max } end |