title: Rails 2.1 to_json with include and methods throwing argument error
body: <p>I have a rails 2.1 app with order which belongs to group.
  I want to return the order with json, include the group (specifically only one table column), and some methods for the order.</p>
  
  <p>I have this code in my show method:</p>
  
  <pre><code>@order = Order.find(params[:id])   
  render :json =&gt; @order.to_json(:include =&gt; { :group =&gt; { :only =&gt; :article_cap }}, :methods =&gt; [:fee, :get_url], :only =&gt; [:id, :group_id])
  </code></pre>
  
  <p>Before, I didn't need the group, and using just 'methods' and 'only' worked fine. Now I need to 'include' the group, and I get this error:</p>
  
  <blockquote>
    <p>ArgumentError (wrong number of arguments (0 for 1)):
    /home/name/.rvm/gems/ruby-1.8.7-p352@code/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `get_url'</p>
    
    <p>...</p>
  </blockquote>
  
  <p>It works fine if I do only the include, or only the methods, but not if I do both at once. Any ideas?</p>
  
  <p>EDIT: I see now that it is trying to call get_url on the associated, included group model (it has the same method as order, but requires passing something to it). I thought you would have to write it as:</p>
  
  <pre><code>:include =&gt; { :group =&gt; { :methods =&gt; :get_url } }
  </code></pre>
  
  <p>for this problem. I can't seem to get it to include the method from the @order.</p>