Method: Mongoid::Criteria#fuse
- Defined in:
- lib/mongoid/criteria.rb
#fuse(criteria_conditions = {}) ⇒ Object
Merges the supplied argument hash into a single criteria
Options:
criteria_conditions: Hash of criteria keys, and parameter values
Example:
criteria.fuse(:where => { :field => "value"}, :limit => 20)
Returns self
123 124 125 126 127 |
# File 'lib/mongoid/criteria.rb', line 123 def fuse(criteria_conditions = {}) criteria_conditions.inject(self) do |criteria, (key, value)| criteria.send(key, value) end end |