Method: Ransack::Nodes::Value#cast
- Defined in:
- lib/ransack/nodes/value.rb
#cast(type) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ransack/nodes/value.rb', line 25 def cast(type) case type when :date cast_to_date(value) when :datetime, :timestamp, :time cast_to_time(value) when :boolean cast_to_boolean(value) when :integer cast_to_integer(value) when :float cast_to_float(value) when :decimal cast_to_decimal(value) when :money cast_to_money(value) else cast_to_string(value) end end |