aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-27 11:52:34 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-27 11:52:34 +0100
commit61555a0df11f535d46a0a631fbb0d0773613d08e (patch)
treeda90ba3ee340a27d89e2bfdc0571092697883181 /activerecord/test/cases
parentdf6f971e3aedf8bb1ec318de95d7ce849e2c9c9e (diff)
downloadrails-61555a0df11f535d46a0a631fbb0d0773613d08e.tar.gz
rails-61555a0df11f535d46a0a631fbb0d0773613d08e.tar.bz2
rails-61555a0df11f535d46a0a631fbb0d0773613d08e.zip
allow AssociationProxy#scoped to take options so that API is the same as Base#scoped
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb
index 4d3751bba5..6412ec0599 100644
--- a/activerecord/test/cases/associations_test.rb
+++ b/activerecord/test/cases/associations_test.rb
@@ -214,6 +214,10 @@ class AssociationProxyTest < ActiveRecord::TestCase
david = developers(:david)
assert_equal david.association(:projects), david.projects.proxy_association
end
+
+ def test_scoped_allows_conditions
+ assert developers(:david).projects.scoped(where: 'foo').where_values.include?('foo')
+ end
end
class OverridingAssociationsTest < ActiveRecord::TestCase