title: Rails 3, Kaminari - Error with :joins when using paginate
body: <p>I have a function for prices with 2 joins and it works fine and dandy when I use it to call for prices. But now when I added Kaminari to be able to paginate, it gave me a error and I wonder if I can customize the "count*" function in Kaminari or is it my function for calling the products that's wrong?</p>
  
  <p>This is in my controller</p>
  
  <pre><code> @prices   = Price.select("`prices`.*").joins(:retailer, :retailer =&gt; :profile).
          where(['product_id=? AND size_id=?', params[:prod_id], params[:si_id]]).
          group(:retailer_id).order("SUM((prices.price * #{params[:amount].to_i}) + profiles.shippingCost)").page(params[:page])
  </code></pre>
  
  <p>Error code:</p>
  
  <pre><code>Mysql2::Error: Column 'retailer_id' in field list is ambiguous: SELECT COUNT(*) AS count_all, retailer_id AS retailer_id FROM `prices` INNER JOIN `retailers` ON `retailers`.`id` = `prices`.`retailer_id` INNER JOIN `profiles` ON `profiles`.`retailer_id` = `retailers`.`id` WHERE (product_id='1' AND size_id='3') GROUP BY retailer_id,retailer_id ORDER BY SUM((prices.price * 1) + profiles.shippingCost)
  </code></pre>
  
  <p>When I call the products without Kaminari the MYSQL looks like this.</p>
  
  <pre><code>SELECT `prices`.* FROM `prices` INNER JOIN `retailers` ON `retailers`.`id` = `prices`.`retailer_id` INNER JOIN `profiles` ON `profiles`.`retailer_id` = `retailers`.`id` WHERE (product_id='1' AND size_id='3') GROUP BY retailer_id ORDER BY SUM((prices.price * 1) + profiles.shippingCost) 
  </code></pre>
  
  <p>Thanks in advance!</p>