views:

38

answers:

1

So for example ...
Lets say I have a Posts model and a News model, that are essentially the same thing (structure wise)
columns are
* title
* content
* createdat
* updatedat

The client has requested showing both news and Posts on the same page interleaved and sorted by created_at date ...
Does anyone know how I would go about doing something like this?

+1  A: 
(Post.all + News.all).sort_by(&:created_at)
cwninja
I want to be like you when I grow up.
concept47
concept47