Created
November 12, 2011 01:11
-
-
Save xntrik/1359842 to your computer and use it in GitHub Desktop.
Smarter ruby method overloading using alias_method
This file contains hidden or 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
http://www.leonardoborges.com/writings/2008/08/07/why-i-like-ruby-1-alias_method/ | |
module ActiveRecord | |
class Base | |
alias_method :find_with_ferret_original, :find_with_ferret | |
def find_with_ferret(q, options = {}, find_options = {}) | |
remove_diatrictics!(q) | |
find_with_ferret_original(q, options, find_options) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment