Permalink
Browse files

Fix incorrect signature for NamedScope#respond_to? [#852 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
1 parent 0d74e72 commit 3724dafe71f4afb2ca9f4d7d2526b228aa6c05a3 @tomlea tomlea committed with lifo Aug 21, 2008
Showing with 7 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/named_scope.rb
  2. +5 −0 activerecord/test/cases/named_scope_test.rb
@@ -140,8 +140,8 @@ def empty?
@found ? @found.empty? : count.zero?
end
- def respond_to?(method)
- super || @proxy_scope.respond_to?(method)
+ def respond_to?(method, include_private = false)
+ super || @proxy_scope.respond_to?(method, include_private)
end
def any?
@@ -52,6 +52,11 @@ def test_scope_should_respond_to_own_methods_and_methods_of_the_proxy
assert Topic.approved.respond_to?(:length)
end
+ def test_respond_to_respects_include_private_parameter
+ assert !Topic.approved.respond_to?(:load_found)
+ assert Topic.approved.respond_to?(:load_found, true)
+ end
+
def test_subclasses_inherit_scopes
assert Topic.scopes.include?(:base)

0 comments on commit 3724daf

Please sign in to comment.