Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# TODO: Temporary patch until https://github.com/rails/rails/issues/8269 is resolved.
warn "WARNING: patch `#{__FILE__}' may break Rails #{Rails.version}" if Rails.version != '3.2.13'
# activerecord/lib/active_record/associations/has_many_through_association.rb
class ActiveRecord::Associations::HasManyThroughAssociation
private
def save_through_record(record)
through_record = build_through_record(record)
if inverse = through_reflection.inverse_of
through_record.send("#{inverse.name}=", owner) if inverse.macro == :belongs_to
end
through_record.save!
ensure
@through_records.delete(record.object_id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.