Method: ActiveEntity::Store::IndifferentHashAccessor.prepare

Defined in:
lib/active_entity/store.rb

.prepare(object, store_attribute) ⇒ Object



251
252
253
254
255
256
257
258
# File 'lib/active_entity/store.rb', line 251

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