title: Find difference between arrays in Ruby, where the elements are hashes
body: <p>I have two arrays of hashes I would like to find the difference between.  My issue is the array elements are single item hashes.</p>
  
  <p>So far, using <code>array1 - array2</code> appears to be working correctly but do I need to watch out for gotchas here?  The hash elements themselves read like <code>h = {'ID' =&gt; '76322'}</code>, where the numeric value differs from hash to hash, so nothing too fancy.</p>
  
  <p>[EDIT]</p>
  
  <p>Here's what I'm looking for:</p>
  
  <pre><code>array1 = []
  array2 = []
  
  h = {'ID' =&gt; '76322'}
  array1.push(h)
  
  h = {'ID' =&gt; '7891'}
  array1.push(h)
  array2.push(h)
  
  array1 = array1 - array2 # should result in array1 having a single hash of values {'ID', '76322'}
  </code></pre>