提交 3724dafe 编写于 作者: T Tom Lea 提交者: Pratik Naik

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

Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
上级 0d74e72e
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册