提交 45291f08 编写于 作者: R Ryuta Kamizono

Add a test case for unscoping `default_scope` in associations

Unscoping `default_scope` in associations has already supported (#17360
for preloading, c9cf8b8d for eager loading).

Fixes #20679.
Closes #16531.
上级 ad80256d
......@@ -2371,8 +2371,9 @@ def test_collection_association_with_private_kernel_method
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册