Method: ManyStoreAssociation#typecast
- Defined in:
- lib/yodel/models/core/associations/store/many_store_association.rb
#typecast(value, record) ⇒ Object
9 10 11 12 13 |
# File 'lib/yodel/models/core/associations/store/many_store_association.rb', line 9 def typecast(value, record) return ChangeSensitiveArray.new(record, name, []) if value.blank? raise "ManyStoreAssociation values must be enumerable (#{name})" unless value.respond_to?(:each) ChangeSensitiveArray.new(record, name, all(value, record)) end |