From 6a13376525f34a00e013fc3a6022838329dfe856 Mon Sep 17 00:00:00 2001 From: jvoorhis Date: Fri, 6 Mar 2009 16:47:50 +0000 Subject: Methods invoked within named scope Procs should respect the scope stack. [#1267 state:resolved] Signed-off-by: Pratik Naik --- activerecord/test/cases/named_scope_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test/cases') 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 -- cgit v1.2.3