aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/type/mutable.rb
blob: 64cf4b9b93526c21bb3dae15ffc0cf85cf3bb125 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module ActiveRecord
  module Type
    module Mutable
      def type_cast_from_user(value)
        type_cast_from_database(type_cast_for_database(value))
      end

      # +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.
      def changed_in_place?(raw_old_value, new_value) # :nodoc:
        raw_old_value != type_cast_for_database(new_value)
      end
    end
  end
end