Sha256: dde57bd13fd15d7c9705942f8f5ebf13f2e7a259c5e0207d317b50d516126503
Contents?: true
Size: 813 Bytes
Versions: 44
Compression:
Stored size: 813 Bytes
Contents
module ActiveRecord module Type class String < Value # :nodoc: def type :string end def changed_in_place?(raw_old_value, new_value) if new_value.is_a?(::String) raw_old_value != new_value end end def type_cast_for_database(value) case value when ::Numeric, ActiveSupport::Duration then value.to_s when ::String then ::String.new(value) when true then "t" when false then "f" else super end end def text? true end private def cast_value(value) case value when true then "t" when false then "f" # String.new is slightly faster than dup else ::String.new(value.to_s) end end end end end
Version data entries
44 entries across 43 versions & 8 rubygems