<?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?|respond_to?)/
+        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</diff>
      <filename>activerecord/lib/active_record/named_scope.rb</filename>
    </modified>
    <modified>
      <diff>@@ -249,6 +249,10 @@ class NamedScopeTest &lt; ActiveRecord::TestCase
     assert_equal Topic.base.select(&amp;:approved), Topic.base.find_all(&amp;:approved)
   end
 
+  def test_rand_should_select_a_random_object_from_proxy
+    assert Topic.approved.rand.is_a? Topic
+  end
+
   def test_should_use_where_in_query_for_named_scope
     assert_equal Developer.find_all_by_name('Jamis'), Developer.find_all_by_id(Developer.jamises)
   end</diff>
      <filename>activerecord/test/cases/named_scope_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6577942b61b98e3bca54c0af3df57f8334b832b9</id>
    </parent>
  </parents>
  <author>
    <name>Jan De Poorter</name>
    <login>DefV</login>
    <email>jan@defv.be</email>
  </author>
  <url>http://github.com/rails/rails/commit/db116a2ed688d36570f412a42e9fc33dcbca56c7</url>
  <id>db116a2ed688d36570f412a42e9fc33dcbca56c7</id>
  <committed-date>2008-08-29T06:06:37-07:00</committed-date>
  <authored-date>2008-08-25T03:37:34-07:00</authored-date>
  <message>Fix NamedScope regex so methods containing &quot;an&quot; get delegated to proxy_found. [#901 state:resolved]

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