Class: ActiveRecord::Store::IndifferentHashAccessor
- Inherits:
-
HashAccessor
- Object
- HashAccessor
- ActiveRecord::Store::IndifferentHashAccessor
- Defined in:
- activerecord/lib/active_record/store.rb
Class Method Summary collapse
Methods inherited from HashAccessor
Class Method Details
.prepare(object, store_attribute) ⇒ Object
165 166 167 168 169 170 171 172 |
# File 'activerecord/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 |