Forum: Ruby on Rails Activerecord default order by

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
234baba7870c09d73a2805438a75d36d?d=identicon&s=25 Martijn van Leeuwen (Guest)
on 2006-01-27 13: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,

Martijn
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-01-27 18:18
(Received via mailing list)
Override find, munge the input, and pass it on to super.

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