title: Rails 3.1 - find using count and select as
body: <p>I am trying to do the following sql statement in rails: </p>
  
  <pre><code>SELECT COUNT(downloads.title) AS total, downloads.title FROM `downloads` WHERE `downloads`.`member_id` = 60 Group by `downloads`.`title`
  </code></pre>
  
  <p>I wrote this in rails like this:</p>
  
  <pre><code>Download.where(:member_id =&gt; id).select("COUNT(downloads.title) AS total, downloads.title").group(:title)
  </code></pre>
  
  <p>If I run the query straight from the sql server the sql executes correctly but if I run the activerecord version I only get the title back.</p>
  
  <p>I thought this might be because of attr_accessible but this doesnt seem to have made a difference.</p>
  
  <p>any ideas ? </p>