From 71312443133c6bbcc518d594789f19a213369f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 21 Jul 2010 15:06:23 +0200 Subject: Ensure default_scope can be overwriten by association conditions. --- activerecord/test/cases/relation_scoping_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test/cases/relation_scoping_test.rb') diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb index fdf4536bc0..a50a4d4165 100644 --- a/activerecord/test/cases/relation_scoping_test.rb +++ b/activerecord/test/cases/relation_scoping_test.rb @@ -259,6 +259,11 @@ class HasManyScopingTest< ActiveRecord::TestCase assert_equal [magician], people(:michael).bad_references end + def test_should_default_scope_on_associations_is_overriden_by_association_conditions + person = people(:michael) + assert_equal [], people(:michael).fixed_bad_references + end + def test_should_maintain_default_scope_on_eager_loaded_associations michael = Person.where(:id => people(:michael).id).includes(:bad_references).first magician = BadReference.find(1) -- cgit v1.2.3