Sha256: fa5499cdc3cfd05540e6d913397d5adc312ab1a6662bf01893d24f8106167247
Contents?: true
Size: 651 Bytes
Versions: 6
Compression:
Stored size: 651 Bytes
Contents
module ActiveRecord module Associations class Association def creation_attributes attributes = {} if (reflection.has_one? || reflection.collection?) && !options[:through] # CPK # attributes[reflection.foreign_key] = owner[reflection.active_record_primary_key] Array(reflection.foreign_key).zip(Array(reflection.active_record_primary_key)).each do |key1, key2| attributes[key1] = owner[key2] end if reflection.type attributes[reflection.type] = owner.class.polymorphic_name end end attributes end end end end
Version data entries
6 entries across 6 versions & 1 rubygems