Sha256: 23e9516bb9c9ef88d93cfe946643d684fa78f07b792795d62891bdd9dd6dfe4c

Contents?: true

Size: 472 Bytes

Versions: 38

Compression:

Stored size: 472 Bytes

Contents

module ActiveModel
  module Type
    module Helpers
      module Mutable # :nodoc:
        def cast(value)
          deserialize(serialize(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)
          raw_old_value != serialize(new_value)
        end
      end
    end
  end
end

Version data entries

38 entries across 37 versions & 5 rubygems

Version Path
activemodel-5.0.7.2 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.7.1 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.7 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.6 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.6.rc1 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.5 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.5.rc2 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.5.rc1 lib/active_model/type/helpers/mutable.rb
tdiary-5.0.5 vendor/bundle/gems/activemodel-5.0.2/lib/active_model/type/helpers/mutable.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/activemodel-5.0.2/lib/active_model/type/helpers/mutable.rb
activemodel-5.0.4 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.4.rc1 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.3 lib/active_model/type/helpers/mutable.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activemodel-5.0.2/lib/active_model/type/helpers/mutable.rb
tdiary-5.0.4 vendor/bundle/gems/activemodel-5.0.2/lib/active_model/type/helpers/mutable.rb
activemodel-5.0.2 lib/active_model/type/helpers/mutable.rb
activemodel-5.0.2.rc1 lib/active_model/type/helpers/mutable.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activemodel-5.0.1/lib/active_model/type/helpers/mutable.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activemodel-5.0.1/lib/active_model/type/helpers/mutable.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activemodel-5.0.1/lib/active_model/type/helpers/mutable.rb