Forum: Ruby on Rails Activerecord default order by

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Martijn van Leeuwen (Guest)
on 2006-01-27 14:55
(Received via mailing list)
Hi Mailinglist,

I hope this isn't a stupid question, but i would like to have a default
order by in my model for all queries made by activerecord. And if i
would like to chance the order i just use :order=>"field" so the default
order by is overrided.

I think this is a basic option of activerecord, but i haven't found the
answer in the docs.

Kind Regards,

Tom M. (Guest)
on 2006-01-27 19:18
(Received via mailing list)
Override find, munge the input, and pass it on to super.

-- Tom M.
This topic is locked and can not be replied to.