method
build_record
v3.2.13 -
Show latest stable
- Class:
ActiveRecord::Associations::Association
build_record(attributes, options)private
No documentation available.
# File activerecord/lib/active_record/associations/association.rb, line 232
def build_record(attributes, options)
reflection.build_association(attributes, options) do |record|
skip_assign = [reflection.foreign_key, reflection.type].compact
attributes = create_scope.except(*(record.changed - skip_assign))
record.assign_attributes(attributes, :without_protection => true)
end
end