title: TypeError: Cannot visit Arel::Nodes::Union
body: <p>I am performing a union over two subsets of my <em>domain</em> table with <code>cnt</code> being a local variable, using arel 2.0.9 and <a href="https://github.com/ernie/squeel" rel="nofollow">squeel</a> 0.8.5 as query interface. </p>
  
  <pre><code>def bla cnt
      Domain.group { some_id }.select { `*` }.select { count(`*`).as(`cnt`) }.having { `cnt` &gt;= cnt }
  end
  </code></pre>
  
  <p>Now when building the union of two calls say <code>cnt(1).union(cnt(1))</code> I get a <code>Arel::Nodes::Union</code> instance.</p>
  
  <p>How do I use this relation to actually get my results? Calling <code>#each</code> yields the very same <code>Arel::Nodes::Union</code> reference and <code>#to_sql</code> results in an <code>TypeError: Cannot visit Arel::Nodes::Union</code>.</p>
  
  <p>Any ideas? I <em>could</em> write the query differently, e.g. by using conditional logic (doable in arel?) ...</p>