Class: Toller::Filters::WhereHandler
- Inherits:
-
Object
- Object
- Toller::Filters::WhereHandler
- Defined in:
- lib/toller/filters/where_handler.rb
Overview
Where handler for filter
Instance Method Summary collapse
-
#call(collection, type, value, properties) ⇒ ActiveRecord::Relation
Applies a plain
whereclause tocollectionfor a non-scope filter.
Instance Method Details
#call(collection, type, value, properties) ⇒ ActiveRecord::Relation
Applies a plain where clause to collection for a non-scope filter.
17 18 19 20 21 22 23 |
# File 'lib/toller/filters/where_handler.rb', line 17 def call(collection, type, value, properties) field_name = properties[:field] mutated_value = value_mutator(type, value) collection.where(field_name => mutated_value) end |