Sha256: 46385873c42b5334ac73ace85d1e3964135f5a6cf4bdcc249ed0cfddc22efdbf
Contents?: true
Size: 685 Bytes
Versions: 35
Compression:
Stored size: 685 Bytes
Contents
module ActiveRecord module Type module Internal # :nodoc: class AbstractJson < ActiveModel::Type::Value # :nodoc: include ActiveModel::Type::Helpers::Mutable def type :json end def deserialize(value) if value.is_a?(::String) ::ActiveSupport::JSON.decode(value) rescue nil else value end end def serialize(value) if value.nil? nil else ::ActiveSupport::JSON.encode(value) end end def accessor ActiveRecord::Store::StringKeyedHashAccessor end end end end end
Version data entries
35 entries across 35 versions & 3 rubygems