aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2016-12-27 10:41:26 -0500
committerGitHub <noreply@github.com>2016-12-27 10:41:26 -0500
commitfb6ac0c5f3227d67d11c89fa7398fbfe183bfb30 (patch)
treee8ecaa6f54a75a61da3c7423c3c0f9b8c576f2ac /activerecord/test
parent4d5ced349ca2b4fe756481f4b01a7a4574457889 (diff)
parent9eee7822ac4bce983ad45a98c4d111eb36285199 (diff)
downloadrails-fb6ac0c5f3227d67d11c89fa7398fbfe183bfb30.tar.gz
rails-fb6ac0c5f3227d67d11c89fa7398fbfe183bfb30.tar.bz2
rails-fb6ac0c5f3227d67d11c89fa7398fbfe183bfb30.zip
Merge pull request #27442 from kamipo/fix_27434
Add a record to target before any callbacks loads the record
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index 558c4b3ed1..482b086e5c 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -2475,7 +2475,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
test "double insertion of new object to association when same association used in the after create callback of a new object" do
reset_callbacks(:save, Bulb) do
- Bulb.after_save { |record| record.car.bulbs.to_a }
+ Bulb.after_save { |record| record.car.bulbs.load }
car = Car.create!
car.bulbs << Bulb.new
assert_equal 1, car.bulbs.size