Added by gabriel scolan over 15 years ago
I'd like to patch the method "before_save" in the model/issue.rb file from a plugin.
I've defined the file my_plugin/lib/issues_model_patch.rb as follow:
require_dependency 'issue'
module IssueModelPatch
def self.included(base) # :nodoc:
base.class_eval do
alias_method_chain :before_save, :patch
end
end
def before_save_with_patch
#do nothing (just to check)
end
end
but it seems the wrapping doesn't work (still execute the before_save )
Can anyone give me a tip on what I'm missing?
thanks
I did it, just forgot to include the line "require 'issue_patch'" in init.rb