Sha256: 192f23cfa17d39ccf18f884b990fad54e81d3b57538ca34bd9aec0fcabbe8ff8

Contents?: true

Size: 380 Bytes

Versions: 2

Compression:

Stored size: 380 Bytes

Contents

require "active_model/type/immutable_string"

module ActiveModel
  module Type
    class String < ImmutableString # :nodoc:
      def changed_in_place?(raw_old_value, new_value)
        if new_value.is_a?(::String)
          raw_old_value != new_value
        end
      end

      private

        def cast_value(value)
          ::String.new(super)
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activemodel-5.1.0.rc1 lib/active_model/type/string.rb
activemodel-5.1.0.beta1 lib/active_model/type/string.rb