Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Wrong variable used inside the block of #concat_records #9824

Closed
wants to merge 3 commits into from

3 participants

@choudhuryanupam

The loop variable was not properly used in the #concat_records method. Fixed the wrong argument while calling the method #insert_record.

@neerajdotname
Collaborator

@anupamc Can you add a test ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
4 activerecord/lib/active_record/associations/collection_association.rb
@@ -507,8 +507,8 @@ def concat_records(records)
records.flatten.each do |record|
raise_on_type_mismatch(record)
- add_to_target(record) do |r|
- result &&= insert_record(record) unless owner.new_record?
+ add_to_target(record) do |rec|
+ result &&= insert_record(rec) unless owner.new_record?
end
end
Something went wrong with that request. Please try again.