Is there a way to include code in a class and all its subclasses and get
the behaviour as if it was included at the end of the code in each of
I would wish find a way to include this module to the
superclass(ActiveRecord::Base) and get the following result:
alias_method :old_price, :price
alias_method :price, :old_price
The module to include would be conditional.
Ex: If the current class is Product I would include ProductExtension.
If the current class is Category I would include CategoryExtension.
Perhaps thereÂ´s a better way to chieve this.Accept suggestions.
Thanks for reading.