mirror of
https://github.com/anteo/redmine_custom_workflows.git
synced 2026-01-26 08:14:20 +00:00
alias_method_chain is deprecated
This commit is contained in:
parent
e8c3e1a9cf
commit
53112b2917
5
init.rb
5
init.rb
@ -15,13 +15,12 @@ end
|
||||
|
||||
require 'redmine_custom_workflows/hooks'
|
||||
|
||||
require File.dirname(__FILE__) + '/lib/redmine_custom_workflows/projects_helper_patch'
|
||||
|
||||
Rails.application.config.to_prepare do
|
||||
unless Project.include?(RedmineCustomWorkflows::ProjectPatch)
|
||||
Project.send(:include, RedmineCustomWorkflows::ProjectPatch)
|
||||
end
|
||||
unless ProjectsHelper.include?(RedmineCustomWorkflows::ProjectsHelperPatch)
|
||||
ProjectsHelper.send(:include, RedmineCustomWorkflows::ProjectsHelperPatch)
|
||||
end
|
||||
unless Attachment.include?(RedmineCustomWorkflows::AttachmentPatch)
|
||||
Attachment.send(:include, RedmineCustomWorkflows::AttachmentPatch)
|
||||
end
|
||||
|
||||
@ -1,20 +1,14 @@
|
||||
module RedmineCustomWorkflows
|
||||
module ProjectsHelperPatch
|
||||
|
||||
def self.included(base)
|
||||
base.send(:include, InstanceMethods)
|
||||
base.class_eval do
|
||||
alias_method_chain :project_settings_tabs, :custom_workflows
|
||||
end
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
def project_settings_tabs_with_custom_workflows
|
||||
tabs = project_settings_tabs_without_custom_workflows
|
||||
def project_settings_tabs
|
||||
tabs = super
|
||||
tabs << {:name => 'custom_workflows', :action => :manage_project_workflow, :partial => 'projects/settings/custom_workflow',
|
||||
:label => :label_custom_workflow_plural} if User.current.allowed_to?(:manage_project_workflow, @project)
|
||||
tabs
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
ProjectsHelper.send(:prepend, RedmineCustomWorkflows::ProjectsHelperPatch)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user