Module: FmStore::Criterion::Exclusion

Included in:
FmStore::Criteria
Defined in:
lib/fm_store/criterion/exclusion.rb

Instance Method Summary collapse

Instance Method Details

#exclude(params = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fm_store/criterion/exclusion.rb', line 5

def exclude(params = {})
  accepted_params = {}
  
  params.each do |field, value|
    field = field.to_s
    
    fm_name = klass.find_fm_name(field)
    
    if fm_name
      accepted_params["#{fm_name}.op"] = "neq"
      accepted_params[fm_name] = value
    end
  end
  
  update_params(accepted_params)
  self
end