aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-06-28 14:32:51 -0400
committerGitHub <noreply@github.com>2017-06-28 14:32:51 -0400
commitf94b2e850330ae9b69c874d1fad8a4a38d736d36 (patch)
tree6e0673b4645e8b1d96ae773e93ea6400b92fb3c3 /activerecord/test/cases/associations
parent8adef0b8336dfc9e75fe036f7957937bfaf6f2f4 (diff)
parentdaec73aa429c37ea3c10d7628922697665776127 (diff)
downloadrails-f94b2e850330ae9b69c874d1fad8a4a38d736d36.tar.gz
rails-f94b2e850330ae9b69c874d1fad8a4a38d736d36.tar.bz2
rails-f94b2e850330ae9b69c874d1fad8a4a38d736d36.zip
Merge pull request #29611 from kamipo/add_test_case_for_unscoping_default_scope
Add a test case for unscoping `default_scope` in associations
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index b02653bbcc..a936017ae3 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -2354,8 +2354,9 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
car = Car.create!
bulb = Bulb.create! name: "other", car: car
- assert_equal bulb, Car.find(car.id).all_bulbs.first
- assert_equal bulb, Car.includes(:all_bulbs).find(car.id).all_bulbs.first
+ assert_equal [bulb], Car.find(car.id).all_bulbs
+ assert_equal [bulb], Car.includes(:all_bulbs).find(car.id).all_bulbs
+ assert_equal [bulb], Car.eager_load(:all_bulbs).find(car.id).all_bulbs
end
test "raises RecordNotDestroyed when replaced child can't be destroyed" do