title: Rails merging two arrays of hashes?
body: <p>I'm having a hard time grasping the logic I'd need to merge two arrays of hashes, It seems I've asked t<a href="https://stackoverflow.com/questions/5545042/ruby-merging-arrays-or-hashes">his question a while back</a> in sort of a different way, I've also tried a few other things like the answers offered here: <a href="https://stackoverflow.com/questions/2947255/merging-arrays-of-hashes">merging arrays of hashes</a></p>
  
  <p>Any sort of help understanding this would be really helpful to me.</p>
  
  <p>Say I have the following array, and this is output from the method itself, so you can imagine those <code>:timestamp</code>s to be <code>Time</code> objects</p>
  
  <pre><code>[
    {:timestamp=&gt;2011-12-19 00:00:00 UTC},
    {:timestamp=&gt;2011-12-19 01:00:00 UTC},
    {:timestamp=&gt;2011-12-19 02:00:00 UTC},
    {:timestamp=&gt;2011-12-19 03:00:00 UTC},
    {:timestamp=&gt;2011-12-19 04:00:00 UTC},
    {:timestamp=&gt;2011-12-19 05:00:00 UTC}
  ]
  </code></pre>
  
  <p>And then an additional array like this, each of which has another value (but sometimes may have a bunch more values besides <code>:count</code>)</p>
  
  <pre><code>[
    {:timestamp=&gt;2011-12-19 02:00:00 UTC, :count=&gt;5},
    {:timestamp=&gt;2011-12-19 04:00:00 UTC, :count=&gt;21}
  ]
  </code></pre>
  
  <p>And result in something like this:</p>
  
  <pre><code>[
    {:timestamp=&gt;2011-12-19 00:00:00 UTC},
    {:timestamp=&gt;2011-12-19 01:00:00 UTC},
    {:timestamp=&gt;2011-12-19 02:00:00 UTC, :count=&gt;5},
    {:timestamp=&gt;2011-12-19 03:00:00 UTC},
    {:timestamp=&gt;2011-12-19 04:00:00 UTC, :count=&gt;21},
    {:timestamp=&gt;2011-12-19 05:00:00 UTC}
  ]
  </code></pre>
  
  <p>Again, thanks for your help, I'm not sure why I just can't figure out the proper design pattern for this.</p>