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:
parent
0d74e72e6d
commit
3724dafe71
2 changed files with 7 additions and 2 deletions
|
@ -140,8 +140,8 @@ module ActiveRecord
|
|||
@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 @@ class NamedScopeTest < ActiveRecord::TestCase
|
|||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue