title: acts-as-taggable-on: find tags with name LIKE, sort by tag_counts?
body: <p>Hi I'm using the rails plugin <code>acts-as-taggable-on</code>and I'm trying to find the top 5 most used tags whose names match and partially match a given query.</p>
  
  <p>When I do <code>User.skill_counts.order('count DESC').limit(5).where('name LIKE ?', params[:query])
  </code></p>
  
  <p>This return the following error:</p>
  
  <pre><code>ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: name: SELECT     tags.*, COUNT(*) AS count FROM       "tags" INNER JOIN users ON users.id = taggings.taggable_id LEFT OUTER JOIN taggings ON tags.id = taggings.tag_id AND taggings.context = 'skills' WHERE     (taggings.taggable_type = 'User') AND (taggings.taggable_id IN(SELECT     users.id FROM       "users")) AND (name LIKE 'asd') GROUP BY  tags.id, tags.name HAVING    COUNT(*) &gt; 0 ORDER BY  count DESC LIMIT 5
  </code></pre>
  
  <p>But when I do <code>User.skill_counts.first.name</code></p>
  
  <p>this returns</p>
  
  <pre><code>"alliteration"
  </code></pre>
  
  <p>I'd appreciate any help on this matter.</p>