title: Merge the data of two arrays of hashes based on values
body: <p>I want to join two arrays. Both arrays contain hashes that have a single key in common: <code>object_id</code>.</p>
  
  <pre><code>data1 = [
    {"pid"=&gt;"126199850741820_2172905", "object_id"=&gt;606621809366286, "xcoord"=&gt;81.885856079404, "ycoord"=&gt;51.116625310174},
    {"pid"=&gt;"126199850741820_2172905", "object_id"=&gt;606621809366286, "xcoord"=&gt;81.885856079404, "ycoord"=&gt;51.116625310174}
  ]
  data2 = [
    {"object_id"=&gt;606621809366286, "name" =&gt; "123"},
    {"object_id"=&gt;606621809366286, "name" =&gt; "321"}
  ]
  </code></pre>
  
  <p>I want to merge the data together based on matching the two <code>object_id</code>'s. Array <code>data1</code> has a hash that contains the key <code>"object_id"</code> with the value <code>"606621809366286"</code> as does <code>data2</code>. I need to merge these two hashes together and output a new hash with the data from the rest of the two hashes. </p>
  
  <p>If there are other key/value pairs that are not the same in the dataset, then it does not matter. I just need to match on those <code>object_ids</code>.</p>