Module: ActiveRecord::Type::Mutable
- Included in:
- ConnectionAdapters::PostgreSQL::OID::Array, ConnectionAdapters::PostgreSQL::OID::Hstore, ConnectionAdapters::PostgreSQL::OID::Json, ConnectionAdapters::PostgreSQL::OID::Point, Serialized
- Defined in:
- lib/active_record/type/mutable.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#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). - #type_cast_from_user(value) ⇒ Object
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.
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 |