I have the following code:

      advertisements_arel = Advertisement.order("advertisements.id
DESC").arel
      @advertisements = (params[:website_id].present? ?
advertisements_arel.where(:website_id => params[:website_id]) :
advertisements_arel).to_a

It returns a struct Arel::SelectManager::Row data
But I'd like it to return an array of Advertisement objects (like it
would normally do) so I can iterate over it more easily. Anyone know how
to do that?

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

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to