Class: Mongoid::Criteria
- Inherits:
-
Object
- Object
- Mongoid::Criteria
- Defined in:
- lib/mongoid_criteria_filter/criteria.rb
Instance Method Summary collapse
Instance Method Details
#add_filter(&block) ⇒ Object
5 6 7 8 |
# File 'lib/mongoid_criteria_filter/criteria.rb', line 5 def add_filter(&block) filter_callbacks << block self end |
#each ⇒ Object
10 11 12 13 14 |
# File 'lib/mongoid_criteria_filter/criteria.rb', line 10 def each apply_filter_callbacks(super(){}).each do |doc| yield(doc) if block_given? end end |