Module: DataMapper::Ambition::Query
- Defined in:
- lib/dm-ambition/query.rb,
lib/dm-ambition/query/filter_processor.rb
Defined Under Namespace
Classes: FilterProcessor
Instance Method Summary collapse
-
#filter(&block) ⇒ Object
TODO: spec and document this.
Instance Method Details
#filter(&block) ⇒ Object
TODO: spec and document this
7 8 9 10 11 |
# File 'lib/dm-ambition/query.rb', line 7 def filter(&block) processor = FilterProcessor.new(block.binding, model) processor.process(sexp_for(block)) self.class.new(repository, model, .merge(:conditions => conditions & processor.conditions)) end |