diff options
author | jvoorhis <jvoorhis@jeremy-voorhiss-macbook.local> | 2009-03-06 16:47:50 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-06 16:47:50 +0000 |
commit | 6a13376525f34a00e013fc3a6022838329dfe856 (patch) | |
tree | b34b909463c39f25de97cf8351ab8452ddfb9d84 /activerecord/test/cases | |
parent | c67d25e3c4e636d7c94909a7398231a634accf46 (diff) | |
download | rails-6a13376525f34a00e013fc3a6022838329dfe856.tar.gz rails-6a13376525f34a00e013fc3a6022838329dfe856.tar.bz2 rails-6a13376525f34a00e013fc3a6022838329dfe856.zip |
Methods invoked within named scope Procs should respect the scope stack. [#1267 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/named_scope_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb index f28285faaf..9f3a3848e2 100644 --- a/activerecord/test/cases/named_scope_test.rb +++ b/activerecord/test/cases/named_scope_test.rb @@ -306,6 +306,10 @@ class NamedScopeTest < ActiveRecord::TestCase # Nested hash conditions with different keys assert_equal [posts(:sti_comments)], Post.with_special_comments.with_post(4).all.uniq end + + def test_methods_invoked_within_scopes_should_respect_scope + assert_equal [], Topic.approved.by_rejected_ids.proxy_options[:conditions][:id] + end end class DynamicScopeMatchTest < ActiveRecord::TestCase |