title: Active Record order by group size
body: <p>I've got an active record query where I'm using group_by</p>
  
  <pre><code>@foo = Foo.group_by(&amp;:relation)
  </code></pre>
  
  <p>Then in the view i'm using</p>
  
  <pre><code>@foo.each do |group, values|
   group x has values.count elements
  end
  </code></pre>
  
  <p>Is there a way I could sort these by the count of each group?</p>