Class: Headmin::Filter::Boolean

Inherits:
Base
  • Object
show all
Defined in:
app/models/headmin/filter/boolean.rb

Constant Summary collapse

OPERATORS =
%w[eq not_eq is_null is_not_null]

Constants inherited from Base

Headmin::Filter::Base::OPERATORS_CONVERT_TO, Headmin::Filter::Base::QUERY_OPERATOR_CONVERT_TO, Headmin::Filter::Base::QUERY_VALUE_CONVERT_TO

Instance Attribute Summary

Attributes inherited from Base

#attribute, #instructions, #raw_value

Instance Method Summary collapse

Methods inherited from Base

#build_query, #conditionals, #display_value, #initialize, #is_i?, #operators, #query, #string, #values

Constructor Details

This class inherits a constructor from Headmin::Filter::Base

Instance Method Details

#cast_value(value) ⇒ Object



6
7
8
# File 'app/models/headmin/filter/boolean.rb', line 6

def cast_value(value)
  ActiveModel::Type::Boolean.new.cast(value)
end

#to_sObject



10
11
12
# File 'app/models/headmin/filter/boolean.rb', line 10

def to_s
  string
end