I need to be able to chain an arbitrary number of sub-selects with UNION using ActiveRelation.
UNION
I\'m a little confused by the ARel implementation of this, si
There's a way to make this work using arel:
tc=TestColumn.arel_table return TestColumn.where(tc[:id] .in(TestColumn.select(:id) .where(:attr1=>true) .union(TestColumn.select(:id) .select(:id) .where(:attr2=>true))))