Didn't succeed in patching the model/issue.rb

Added by gabriel scolan almost 8 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

Replies (1)

RE: Didn't succeed in patching the model/issue.rb - Added by gabriel scolan almost 8 years ago

I did it, just forgot to include the line "require 'issue_patch'" in init.rb

(1-1/1)