class ActiveRecord::Store::IndifferentHashAccessor

Public Class Methods

prepare(object, store_attribute) click to toggle source
# File lib/active_record/store.rb, line 165
def self.prepare(object, store_attribute)
  attribute = object.send(store_attribute)
  unless attribute.is_a?(ActiveSupport::HashWithIndifferentAccess)
    attribute = IndifferentCoder.as_indifferent_hash(attribute)
    object.send :"#{store_attribute}=", attribute
  end
  attribute
end