search for: rel_b

Displaying 1 result from an estimated 1 matches for "rel_b".

Did you mean: reg_b
2011 Apr 10
0
Arel Union does not support #order or #limit
...(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_models`.* FROM `my_models` > WHERE (`my_models`.`id` = 3) UNION SELE...