Today I wrote a plugin for Redmine and ended up using alias_method_chain.
Its a very handy little method! What does do? It allows for convenient overrides of methods built-in to a Ruby on Rails application.
Its syntax sugar, really. This:
alias_method_chain :mymethod, :origmethod
simply encapsulates these two calls:
alias_method :mymethod_without_origmethod, :mymethod alias_method :mymethod, :mymethod_with_origmethod
A better way to explain this is:
alias_method_chain :mymethod, :achange
which equals:
alias_method :mymethod_without_achange, :mymethod alias_method :mymethod, :mymethod_with_achange