union all

This commit is contained in:
Ilion Beyst 2015-09-10 15:59:22 +02:00
parent 81b30902f7
commit bd99e150a4

View file

@ -8,7 +8,7 @@ class TransactionsQuery
def arel def arel
Arel::SelectManager.new(ActiveRecord::Base) Arel::SelectManager.new(ActiveRecord::Base)
.from(issued_by(User).union(issued_by(Client))) .from(issued_by(User).union(:all, issued_by(Client)))
.project(Arel.star) .project(Arel.star)
end end
@ -30,7 +30,7 @@ class TransactionsQuery
def transactions def transactions
Arel::Nodes::TableAlias.new( Arel::Nodes::TableAlias.new(
incoming.union(outgoing), incoming.union(:all, outgoing),
@perspectived.name @perspectived.name
) )
end end