method
insert_record
v2.1.0 -
Show latest stable
- Class:
ActiveRecord::Associations::HasManyThroughAssociation
insert_record(record, force=true)protected
No documentation available.
# File activerecord/lib/active_record/associations/has_many_through_association.rb, line 52
def insert_record(record, force=true)
if record.new_record?
if force
record.save!
else
return false unless record.save
end
end
klass = @reflection.through_reflection.klass
@owner.send(@reflection.through_reflection.name).proxy_target << klass.send(:with_scope, :create => construct_join_attributes(record)) { klass.create! }
end