Method: ActiveType::TypeCaster#type_cast_from_user

Defined in:
lib/active_type/type_caster.rb

#type_cast_from_user(value) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/active_type/type_caster.rb', line 20

def type_cast_from_user(value)
  # For some reason, Rails defines additional type casting logic
  # outside the classes that have that responsibility.
  case @type
  when :integer
    cast_integer(value)
  when :timestamp, :datetime
    cast_time(value)
  else
    native_type_cast_from_user(value)
  end
end