This seems like a really simple question but I haven't seen it answered anywhere.
In rails if you have:
class Article < ActiveRecord::Base
has_many :comments
end
class Comments < ActiveRecord::Base
belongs_to :article
end
Why can't you order the comments with something like this:
@article.comments(:order=>"created_at DESC")
Named scope works if you need to reference it a lot and even people do stuff like this:
@article.comments.sort { |x,y| x.created_at <=> y.created_at }
But something tells me it should be simpler. What am I missing?