title: Array Merge (Union)
body: <p>I have two array I need to merge, and using the Union (|) operator is PAINFULLY slow.. are there any other ways to accomplish an array merge?</p>
  
  <p>Also, the arrays are filled with objects, not strings. </p>
  
  <p>An Example of the objects within the array </p>
  
  <pre><code>#&lt;Article 
   id: 1, 
   xml_document_id: 1, 
   source: "&lt;article&gt;&lt;domain&gt;events.waikato.ac&lt;/domain&gt;&lt;excerpt...", 
   created_at: "2010-02-11 01:32:46", 
   updated_at: "2010-02-11 01:41:28"
  &gt;
  </code></pre>
  
  <p>Where source is a short piece of XML.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Sorry! By 'merge' I mean I need to not insert duplicates.</p>
  
  <pre><code>A =&gt; [1, 2, 3, 4, 5]
  B =&gt; [3, 4, 5, 6, 7]
  A.magic_merge(B) #=&gt; [1, 2, 3, 4, 5, 6, 7]
  </code></pre>
  
  <p>Understanding that the integers are actually Article objects, and the Union operator appears to take <em>forever</em></p>