I have 2 queries that are very different:
Model.where(:a => '1', b => '2', c => '3', d => '4')
Model.where(:e => '5', f => '6')
Is it a good (or valid) practice to get the union the results as follows?
models = Model.where(:a => '1', b => '2', c => '3', d => '4')
models += Model.where(:e => '5', f => '6')
Working in Rails 3.07. This is not the actual query. It is simplified for the example.
EDIT:
Sorry, I was not explicit. The goal is to get the union (the sum of results).
In the event that there is overlap in the two result sets, you may get duplicate values. Try the pipe operator instead: