Displaying 1 result from an estimated 1 matches for "rel_a".
Did you mean:
reg_a
2011 Apr 10
0
Arel Union does not support #order or #limit
...ight direction toward a
solution. Here is a description of the problem (from the ticket - https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6693-arel-union-does-not-support-order-or-limit)
:
> If we take two `ActiveRecord::Relations` and join them via `union`:
>
> rel_a = ActiveRecord::Relation.new(MyModel).where(:id => 3)
> rel_b = ActiveRecord::Relation.new(MyModel).where(:id => 5)
> new_rel = rel_a.union(rel_b)
> new_rel.to_s #=> "#<Arel::Nodes::Union:0x3da6260>"
> new_rel.to_sql #=> "( SELECT `my_m...