Module: ActiveRecord::Type::Mutable

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#changed_in_place?(raw_old_value, new_value) ⇒ Boolean

raw_old_value will be the ‘_before_type_cast` version of the value (likely a string). new_value will be the current, type cast value.

Returns:



11
12
13
# File 'lib/active_record/type/mutable.rb', line 11

def changed_in_place?(raw_old_value, new_value)
  raw_old_value != type_cast_for_database(new_value)
end

#type_cast_from_user(value) ⇒ Object



4
5
6
# File 'lib/active_record/type/mutable.rb', line 4

def type_cast_from_user(value)
  type_cast_from_database(type_cast_for_database(value))
end