On Mon, Feb 21, 2011 at 2:48 PM, Paul Bergstrom wrote:
> I think I'm on the right track. But I get the first post for each user,
> not the latest. This is what I use.
>
> Model.all(:select => "*, max(id)", :group => :user_id)
>
> How do get the latest?
>
> In Rails 3 syntax,
Post.where(:user_id =>
I think I'm on the right track. But I get the first post for each user,
not the latest. This is what I use.
Model.all(:select => "*, max(id)", :group => :user_id)
How do get the latest?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the G
2 matches
Mail list logo