ruby - Changing behavior in an existing model class in Rails (inside Redmine) - How to load it? -


i building plugin redmine , have calculate cost of issues based on customized fields.

so made change class issue (the original model class defined in redmine itself) creating "cost" method.

class issue < activerecord::base     def cost        return 100     end    end 

the point here how load change. i've tried create "issue.rb" in "models" folder method remained unseen views. appended class definition plugin's "init.rb" , worked, feel not right place leave code. question is: what "right" way load issue extension recognized in whole app?


Comments