Skip to content

Instantly share code, notes, and snippets.

@moser
Created March 5, 2009 10:58
Show Gist options
  • Save moser/74294 to your computer and use it in GitHub Desktop.
Save moser/74294 to your computer and use it in GitHub Desktop.
replaced by default_scope
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