Created
March 5, 2009 10:58
-
-
Save moser/74294 to your computer and use it in GitHub Desktop.
replaced by default_scope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class Model < ActiveRecord::Base | |
def self.find(*args) | |
order = {:order => "name ASC"} | |
if args.length <= 1 | |
args << order | |
else | |
args[1] = order.merge(args[1]) | |
end | |
super | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment