Class: Dorsale::BillingMachine::SmallData::FilterStrategyByState

Inherits:
SmallData::FilterStrategy show all
Defined in:
app/models/dorsale/billing_machine/small_data/filter_strategy_by_state.rb

Instance Method Summary collapse

Instance Method Details

#apply(query, value) ⇒ Object



5
6
7
8
9
10
11
# File 'app/models/dorsale/billing_machine/small_data/filter_strategy_by_state.rb', line 5

def apply(query, value)
  if value.to_s.match(/not_(.+)/)
    query.where("state != ?", $~[1])
  else
    query.where(state: value)
  end
end