Skip to Content Skip to Search
Methods
A
C
D
S
T
Included Modules

Instance Public methods

accessor()

# File activerecord/lib/active_record/type/json.rb, line 25
def accessor
  ActiveRecord::Store::StringKeyedHashAccessor
end

changed_in_place?(raw_old_value, new_value)

# File activerecord/lib/active_record/type/json.rb, line 21
def changed_in_place?(raw_old_value, new_value)
  deserialize(raw_old_value) != new_value
end

deserialize(value)

# File activerecord/lib/active_record/type/json.rb, line 12
def deserialize(value)
  return value unless value.is_a?(::String)
  ActiveSupport::JSON.decode(value) rescue nil
end

serialize(value)

# File activerecord/lib/active_record/type/json.rb, line 17
def serialize(value)
  ActiveSupport::JSON.encode(value) unless value.nil?
end

type()

# File activerecord/lib/active_record/type/json.rb, line 8
def type
  :json
end