title: How do I perform a full join in ARel?
body: <p>Assume I have two tables <code>TableA</code> and <code>TableB</code> with a many-to-many relationship through a joining table <code>TableABJoin</code>. I would like to use ARel 3 to generate a query that performs a full join of <code>TableA</code> and <code>TableB</code>.</p>
  
  <p>The query I want to generate should be something along these lines:</p>
  
  <pre><code>SELECT a.id, b.code
  FROM TableA as a, TableB as b
  </code></pre>
  
  <p>This results in a full join of tables A and B.</p>
  
  <p>The closest I have been able to get, without writing an explicit sql string, is to hack an outer join:</p>
  
  <pre><code>part_a = TableA.arel_table
  part_b = TableB.arel_table
  query = part_a.join(part_b, Arel::Nodes::OuterJoin).on('1=1').project(part_a[:id], part_b[:code]).to_sql
  </code></pre>
  
  <p>This produces the following SQL:</p>
  
  <pre><code>SELECT "TableA"."id", "TableB"."code" FROM "TableA" LEFT OUTER JOIN "TableB" ON 1=1
  </code></pre>
  
  <p>If I exclude the <code>.on</code> component I end up with a trailing NULL:</p>
  
  <pre><code>SELECT "TableA"."id", "TableB"."code" FROM "TableA" LEFT OUTER JOIN "TableB" NULL
  </code></pre>
  
  <p>Is there a more reasonable way to generate a proper full join or at least generate the same result without hacking a left outer join in ARel?</p>