Sweet - wasn't aware of that one
Thanks
:)
Gavin
http://handyrailstips.com
--
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
Gavin Morrice wrote:
>
> Off the top of my head, try:
>
> Category.all :include => :articles, :order => "articles.published_on
> DESC"
Works like a charm - thanks!
Now that you got my head pointed in the right direction ;-) I noticed,
that :joins does the same job for me (ie. same result) w
Carsten Gehling wrote:
> My head is spinning a bit this morning - can somebody help me with this?
>
> Given these two models with the following associations:
>
> class Article < ActiveRecord::Base
> belongs_to :category
>
> - has an attribute called "published_on"
> end
>
> class Category
3 matches
Mail list logo