aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relation_scoping_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-06 18:04:32 +0000
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-07 15:03:15 -0800
commit770e6893b9f2aaaebe3de10576931dc7194451bc (patch)
treea69337db0ed7743d302a9d54c142efa5447ab810 /activerecord/test/cases/relation_scoping_test.rb
parent441118458d57011ee1b1f1dcfea558de462c6da9 (diff)
downloadrails-770e6893b9f2aaaebe3de10576931dc7194451bc.tar.gz
rails-770e6893b9f2aaaebe3de10576931dc7194451bc.tar.bz2
rails-770e6893b9f2aaaebe3de10576931dc7194451bc.zip
Construct an actual ActiveRecord::Relation object for the association scope, rather than a hash which is passed to apply_finder_options. This allows more flexibility in how the scope is created, for example because scope.where(a, b) and scope.where(a).where(b) mean different things.
Diffstat (limited to 'activerecord/test/cases/relation_scoping_test.rb')
-rw-r--r--activerecord/test/cases/relation_scoping_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb
index bff0151f1a..1bdf3136d4 100644
--- a/activerecord/test/cases/relation_scoping_test.rb
+++ b/activerecord/test/cases/relation_scoping_test.rb
@@ -259,7 +259,8 @@ class HasManyScopingTest< ActiveRecord::TestCase
end
def test_should_default_scope_on_associations_is_overriden_by_association_conditions
- assert_equal [], people(:michael).fixed_bad_references
+ reference = references(:michael_unicyclist).becomes(BadReference)
+ assert_equal [reference], people(:michael).fixed_bad_references
end
def test_should_maintain_default_scope_on_eager_loaded_associations