Class: Toller::Filters::WhereHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/toller/filters/where_handler.rb

Overview

Where handler for filter

Instance Method Summary collapse

Instance Method Details

#call(collection, type, value, properties) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/toller/filters/where_handler.rb', line 9

def call(collection, type, value, properties)
  field_name = properties[:field]

  mutated_value = value_mutator(type, value)

  collection.where(field_name => mutated_value)
end