Project

General

Profile

before_save callback getting called twice

Added by Razi Baluchi over 12 years ago

I'm sure I'm doing something wrong but I can't quite figure out what it is. I have written a simple plugin that calls a shell script whenever an issue is updated. Unfortunately it seems to be getting called twice. Here's the code:

require_dependency 'issue'

module RedmineDeployPatch

  def self.included(base)
    base.send(:include, InstanceMethods)
    base.class_eval do
      alias_method_chain :before_save, :deploy_script
    end
  end

  module InstanceMethods
    def before_save_with_deploy_script
        Kernel.system("/apps/deployment/scripts/deploy.ksh testing")
    end
  end

end

Any suggestions on where to look?