Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test case for unscoping default_scope in associations #29611

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2354,8 +2354,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
Expand Down