title: Best way to compare two array of objects in rails
body: <p>I have two array of objects for example:</p>
  
  <pre><code>a1 = [obj1, obj2 , obj3]
  a2 = [obj4, obj5, obj6]
  </code></pre>
  
  <p>Each array has different objects of the same class. I want to check whether they have the same attribute value (<code>obj1.att == obj4.att</code>) in a single iteration.</p>
  
  <p><code>a1.each</code> will do iteration on a single array. I don't want to use <code>for</code> or <code>while</code> loop. I want a rails way to do that. </p>