class ActiveRecord::Store::HashAccessor
Public Class Methods
prepare(object, attribute)
click to toggle source
# File lib/active_record/store.rb, line 149 def self.prepare(object, attribute) object.public_send :"#{attribute}=", {} unless object.send(attribute) end
read(object, attribute, key)
click to toggle source
# File lib/active_record/store.rb, line 136 def self.read(object, attribute, key) prepare(object, attribute) object.public_send(attribute)[key] end
write(object, attribute, key, value)
click to toggle source
# File lib/active_record/store.rb, line 141 def self.write(object, attribute, key, value) prepare(object, attribute) if value != read(object, attribute, key) object.public_send :"#{attribute}_will_change!" object.public_send(attribute)[key] = value end end