title: problem with will_paginate with render json in rails 2.3.11
body: <p>I am trying to upgrade my rails gem from 2.3.2 to 2.3.11. However, I got some problems with will_paginate 2.3.15 and render json back.</p>
  
  <pre><code>module WillPaginateHelpers
      WillPaginate::Collection.class_eval do
        alias :to_json_without_paginate :to_json
  
          def to_json(options = {})
            hash = { :current_page =&gt; current_page,
              :per_page =&gt; per_page,
              :total_entries =&gt; total_entries,
              :total_pages =&gt; total_pages,
              :items =&gt; to_a
            }
  
            hash.to_json(options)
          end
      end
  end
  </code></pre>
  
  <p>Previously, the code above could work with: </p>
  
  <pre><code>@products = Product.paginate(:page =&gt; 1, :per_page =&gt; 20)
  render :json =&gt; @products
  </code></pre>
  
  <p>However, with rails 2.3.11, it comes up with error "object references itself" unless i need to code this way: <code>render :json =&gt; @products.to_json</code>.
  How to fix this? What happened with <code>render :json =&gt; @products</code>?</p>