Skip to content

Instantly share code, notes, and snippets.

@Sutto
Created July 24, 2008 19:08
Show Gist options
  • Save Sutto/2254 to your computer and use it in GitHub Desktop.
Save Sutto/2254 to your computer and use it in GitHub Desktop.
class Whatever < ActiveRecord::Base
class << self
def find_with_awesome(*args)
opts = args.extract_options!
if opts.has_key?(:awesome)
awesome = opts.delete(:awesome)
# process something here....
end
find_without_awesome(*(args << opts))
end
alias_method_chain :find, :awesome
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment