title: Ruby equivalent of ActiveRecord Group by query
body: <p>I want to perform an operation on a array returned from an ActiveRecord query. This is the functionality I would have done on the ActiveRecord directly.</p>
  
  <pre><code>Modification.find(:all, :group=&gt;'ref_id,start_date', :order=&gt;'updated_at desc')
  </code></pre>
  
  <p>The above is working fine as expected. But the problem is I cannot perform it directly for some reasons. But I have an array. I cannot use <code>:group</code> symbol on an array for the obvious reason that is not an ActiveRecord. But I would want the same functionality. Something like</p>
  
  <pre><code>modifications = Modification.all
  modifications.find(:all, :group=&gt;'ref_id,start_date').sort(:order=&gt;&amp;:updated_at)
  </code></pre>
  
  <p>The above one would not work for obvious reasons, but how to do a similar ActiveRecord implementation for the Array.</p>