class ActiveRecord::Associations::Association

Private Instance Methods

build_record(attributes, options) click to toggle source
# File lib/active_record/mass_assignment_security/associations.rb, line 4
def build_record(attributes, options)
  reflection.build_association(attributes, options) do |record|
    attributes = create_scope.except(*(record.changed - [reflection.foreign_key]))
    record.assign_attributes(attributes, without_protection: true)
  end
end