Skip to content

Commit 8f67ca1

Browse files
Iterate over all records in Transaction#before_commit_records
Follow up to rails@6175f73: we need to iterate over all records instead of the unique records when finding callback candidates.
1 parent 19b08e2 commit 8f67ca1

File tree

1 file changed

+1
-1
lines changed
  • activerecord/lib/active_record/connection_adapters/abstract

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/connection_adapters/abstract/transaction.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def before_commit_records
173173
if @run_commit_callbacks
174174
ite = unique_records
175175

176-
instances_to_run_callbacks_on = ite.each_with_object({}) do |record, candidates|
176+
instances_to_run_callbacks_on = records.each_with_object({}) do |record, candidates|
177177
candidates[record] = record
178178
end
179179

0 commit comments

Comments
 (0)