title: How to merge hashes if a specified key's values are same in a array
body: <p>I have a array of hashes like this:</p>
  
  <pre><code>[ {:foo=&gt;2, :date=&gt;Sat, 01 Sep 2014},
   {:foo2=&gt;2, :date=&gt;Sat, 02 Sep 2014},
   {:foo3=&gt;3, :date=&gt;Sat, 01 Sep 2014},
   {:foo4=&gt;4, :date=&gt;Sat, 03 Sep 2014},
    {:foo5=&gt;5, :date=&gt;Sat, 02 Sep 2014}]
  </code></pre>
  
  <p>And I want to merge hashes if the <code>:date</code> are same.
  What I expect from the array above is:</p>
  
  <pre><code>[ {:foo=&gt;2, :foo3=&gt;3, :date=&gt;Sat, 01 Sep 2014},
   {:foo2=&gt;2, :foo5=&gt;5 :date=&gt;Sat, 02 Sep 2014},
   {:foo4=&gt;4, :date=&gt;Sat, 03 Sep 2014}]
  </code></pre>
  
  <p>How can I do it?</p>
  
  <p>Maybe should I reconsider data structure itself? For example should I use <code>date</code> value as a key of hash?</p>