Re: Merging multiple AR result hashes into one for view loop

Bryan Duxbury
Fri, 23 Mar 2007 15:21:05 -0000

The has_many collections aren''t hashes, they''re arrays. You
can
concatenate arrays with a + like so:

for result in User.model1 + User.model2 + User.model3
...
end

If you''re worried about their sort order, you can sort them manually
with the Array#sort_by method.

--
Posted via http://www.ruby-forum.com/.