1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
Tom Lea 2008-08-21 16:38:27 +01:00 committed by Pratik Naik
parent 0d74e72e6d
commit 3724dafe71
2 changed files with 7 additions and 2 deletions

View file

@ -140,8 +140,8 @@ module ActiveRecord
@found ? @found.empty? : count.zero? @found ? @found.empty? : count.zero?
end end
def respond_to?(method) def respond_to?(method, include_private = false)
super || @proxy_scope.respond_to?(method) super || @proxy_scope.respond_to?(method, include_private)
end end
def any? def any?

View file

@ -52,6 +52,11 @@ class NamedScopeTest < ActiveRecord::TestCase
assert Topic.approved.respond_to?(:length) assert Topic.approved.respond_to?(:length)
end 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 def test_subclasses_inherit_scopes
assert Topic.scopes.include?(:base) assert Topic.scopes.include?(:base)