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 'redmine_custom_workflows/hooks'
|
||||||
|
|
||||||
|
require File.dirname(__FILE__) + '/lib/redmine_custom_workflows/projects_helper_patch'
|
||||||
|
|
||||||
Rails.application.config.to_prepare do
|
Rails.application.config.to_prepare do
|
||||||
unless Project.include?(RedmineCustomWorkflows::ProjectPatch)
|
unless Project.include?(RedmineCustomWorkflows::ProjectPatch)
|
||||||
Project.send(:include, RedmineCustomWorkflows::ProjectPatch)
|
Project.send(:include, RedmineCustomWorkflows::ProjectPatch)
|
||||||
end
|
end
|
||||||
unless ProjectsHelper.include?(RedmineCustomWorkflows::ProjectsHelperPatch)
|
|
||||||
ProjectsHelper.send(:include, RedmineCustomWorkflows::ProjectsHelperPatch)
|
|
||||||
end
|
|
||||||
unless Attachment.include?(RedmineCustomWorkflows::AttachmentPatch)
|
unless Attachment.include?(RedmineCustomWorkflows::AttachmentPatch)
|
||||||
Attachment.send(:include, RedmineCustomWorkflows::AttachmentPatch)
|
Attachment.send(:include, RedmineCustomWorkflows::AttachmentPatch)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,20 +1,14 @@
|
|||||||
module RedmineCustomWorkflows
|
module RedmineCustomWorkflows
|
||||||
module ProjectsHelperPatch
|
module ProjectsHelperPatch
|
||||||
|
|
||||||
def self.included(base)
|
def project_settings_tabs
|
||||||
base.send(:include, InstanceMethods)
|
tabs = super
|
||||||
base.class_eval do
|
tabs << {:name => 'custom_workflows', :action => :manage_project_workflow, :partial => 'projects/settings/custom_workflow',
|
||||||
alias_method_chain :project_settings_tabs, :custom_workflows
|
:label => :label_custom_workflow_plural} if User.current.allowed_to?(:manage_project_workflow, @project)
|
||||||
end
|
tabs
|
||||||
end
|
end
|
||||||
|
|
||||||
module InstanceMethods
|
|
||||||
def project_settings_tabs_with_custom_workflows
|
|
||||||
tabs = project_settings_tabs_without_custom_workflows
|
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ProjectsHelper.send(:prepend, RedmineCustomWorkflows::ProjectsHelperPatch)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user