123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Store::HashAccessor

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: activerecord/lib/active_record/store.rb

Class Method Summary

Class Method Details

.prepare(object, attribute)

[ GitHub ]

  
# File 'activerecord/lib/active_record/store.rb', line 238

def self.prepare(object, attribute)
  object.public_send :"#{attribute}=", {} unless object.send(attribute)
end

.read(object, attribute, key)

[ GitHub ]

  
# File 'activerecord/lib/active_record/store.rb', line 228

def self.read(object, attribute, key)
  prepare(object, attribute)
  object.public_send(attribute)[key]
end

.write(object, attribute, key, value)

[ GitHub ]

  
# File 'activerecord/lib/active_record/store.rb', line 233

def self.write(object, attribute, key, value)
  prepare(object, attribute)
  object.public_send(attribute)[key] = value if value != read(object, attribute, key)
end