<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -103,7 +103,7 @@ module ActiveRecord
       attr_reader :proxy_scope, :proxy_options
 
       [].methods.each do |m|
-        unless m =~ /(^__|^nil\?|^send|^object_id$|class|extend|find|count|sum|average|maximum|minimum|paginate|first|last|empty?|any?)/
+        unless m =~ /(^__|^nil\?|^send|^object_id$|class|extend|find|count|sum|average|maximum|minimum|paginate|first|last|empty?|any?|respond_to?)/
           delegate m, :to =&gt; :proxy_found
         end
       end
@@ -140,6 +140,10 @@ module ActiveRecord
         @found ? @found.empty? : count.zero?
       end
 
+      def respond_to?(method)
+        super || @proxy_scope.respond_to?(method)
+      end
+
       def any?
         if block_given?
           proxy_found.any? { |*block_args| yield(*block_args) }</diff>
      <filename>activerecord/lib/active_record/named_scope.rb</filename>
    </modified>
    <modified>
      <diff>@@ -45,6 +45,12 @@ class NamedScopeTest &lt; ActiveRecord::TestCase
     assert_equal Topic.average(:replies_count), Topic.base.average(:replies_count)
   end
 
+  def test_scope_should_respond_to_own_methods_and_methods_of_the_proxy
+    assert Topic.approved.respond_to?(:proxy_found)
+    assert Topic.approved.respond_to?(:count)
+    assert Topic.approved.respond_to?(:length)
+  end
+
   def test_subclasses_inherit_scopes
     assert Topic.scopes.include?(:base)
 </diff>
      <filename>activerecord/test/cases/named_scope_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>282b42021306f73d4cc8f8a06713da9a55ed044b</id>
    </parent>
  </parents>
  <author>
    <name>Eloy Duran</name>
    <email>eloy.de.enige@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/1ee9e3fa5c924bef4aba3d53796f48f5badbd06f</url>
  <id>1ee9e3fa5c924bef4aba3d53796f48f5badbd06f</id>
  <committed-date>2008-08-13T05:04:42-07:00</committed-date>
  <authored-date>2008-08-13T04:36:39-07:00</authored-date>
  <message>Fix ActiveRecord::NamedScope::Scope#respond_to? [#818 state:resolved]

Signed-off-by: Pratik Naik &lt;pratiknaik@gmail.com&gt;</message>
  <tree>92664231bee7c307ab3bb431b226d0cc98a13dac</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
