public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Fix incorrect signature for NamedScope#respond_to? [#852 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Tom Lea (author)
Thu Aug 21 08:38:27 -0700 2008
lifo (committer)
Thu Aug 21 08:39:27 -0700 2008
commit  3724dafe71f4afb2ca9f4d7d2526b228aa6c05a3
tree    bfe8bf6484940c610660e18ae2b68c0bee3984fe
parent  0d74e72e6de7b96e158950a449ea1ccce6f5b8d7
...
140
141
142
143
144
 
 
145
146
147
...
140
141
142
 
 
143
144
145
146
147
0
@@ -140,8 +140,8 @@ module ActiveRecord
0
         @found ? @found.empty? : count.zero?
0
       end
0
 
0
-      def respond_to?(method)
0
-        super || @proxy_scope.respond_to?(method)
0
+      def respond_to?(method, include_private = false)
0
+        super || @proxy_scope.respond_to?(method, include_private)
0
       end
0
 
0
       def any?
...
52
53
54
 
 
 
 
 
55
56
57
...
52
53
54
55
56
57
58
59
60
61
62
0
@@ -52,6 +52,11 @@ class NamedScopeTest < ActiveRecord::TestCase
0
     assert Topic.approved.respond_to?(:length)
0
   end
0
 
0
+  def test_respond_to_respects_include_private_parameter
0
+    assert !Topic.approved.respond_to?(:load_found)
0
+    assert Topic.approved.respond_to?(:load_found, true)
0
+  end
0
+
0
   def test_subclasses_inherit_scopes
0
     assert Topic.scopes.include?(:base)
0
 

Comments