method
creation_attributes
v3.2.8 -
Show latest stable
- Class:
ActiveRecord::Associations::Association
creation_attributes()private
No documentation available.
# File activerecord/lib/active_record/associations/association.rb, line 168
def creation_attributes
attributes = {}
if reflection.macro.in?([:has_one, :has_many]) && !options[:through]
attributes[reflection.foreign_key] = owner[reflection.active_record_primary_key]
if reflection.options[:as]
attributes[reflection.type] = owner.class.base_class.name
end
end
attributes
end