problem with overwrite methods
I am trying to write plugin which overwrite 2 methods of app/model/issue.rb
I see that this new code is not executed and RM works as if this was not included?
What I am doing wrong?
My version of RM is 2.5.1
RE: problem with overwrite methods - Added by Martin Denizet (redmine.org team member) almost 4 years ago
The code you linked allows to extend the class (Add method and properties).
To override methods, you will want to use
You can check this example in which I wrap the
settings action of the project controller.
alias_method_chain works as follow:
alias_method_chain :<method to override>, :<name of the override>
After that, you have to define the class method
<method to override>_with_<name of the override> and you can still call the original method with:
<method to override>_without_<name of the override>
Hope it helps,
RE: problem with overwrite methods - Added by Dariusz Kowalski almost 4 years ago
Thank You, it works.