-
Notifications
You must be signed in to change notification settings - Fork 20
/
init.rb
70 lines (56 loc) · 2.91 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Redmine::Plugin.register :redmine_category_tree do
name 'Redmine Category Tree'
author 'Brett Patterson'
description 'Adds ability for categories to have "children"'
version '1.0.0'
permission :move_category, :issue_categories => :move_category
requires_redmine :version_or_higher => '4.0.0'
end
require 'redmine_category_tree/hooks/redmine_category_tree_hooks'
require File.dirname(__FILE__) + '/app/views/helpers/redmine_category_tree/issue_category_helper.rb'
Rails.configuration.to_prepare do
#((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do
## Helpers first
require_dependency 'application_helper'
unless ApplicationHelper.included_modules.include?(RedmineCategoryTree::Patches::ApplicationHelperPatch)
ApplicationHelper.send(:prepend, RedmineCategoryTree::Patches::ApplicationHelperPatch)
end
require_dependency 'queries_helper'
unless QueriesHelper.included_modules.include?(RedmineCategoryTree::Patches::QueriesHelperPatch)
QueriesHelper.send(:prepend, RedmineCategoryTree::Patches::QueriesHelperPatch)
end
require_dependency 'issues_helper'
unless IssuesHelper.included_modules.include?(RedmineCategoryTree::Patches::IssuesHelperPatch)
IssuesHelper.send(:prepend, RedmineCategoryTree::Patches::IssuesHelperPatch)
end
## Models
require_dependency 'issue_category'
unless IssueCategory.included_modules.include?(RedmineCategoryTree::Patches::IssueCategoryPatch)
IssueCategory.send(:prepend, RedmineCategoryTree::Patches::IssueCategoryPatch)
end
require_dependency 'issue_query'
unless IssueQuery.ancestors.include?(RedmineCategoryTree::Patches::IssueQueryPatch)
IssueQuery.send(:prepend, RedmineCategoryTree::Patches::IssueQueryPatch)
end
require_dependency 'project'
unless Project.included_modules.include?(RedmineCategoryTree::Patches::ProjectPatch)
Project.send(:prepend, RedmineCategoryTree::Patches::ProjectPatch)
end
## Controllers
require_dependency 'issues_controller'
unless IssuesController.included_modules.include?(RedmineCategoryTree::Patches::IssuesControllerPatch)
IssuesController.send(:prepend, RedmineCategoryTree::Patches::IssuesControllerPatch)
end
require_dependency 'issue_categories_controller'
unless IssueCategoriesController.included_modules.include?(RedmineCategoryTree::Patches::IssueCategoriesControllerPatch)
IssueCategoriesController.send(:prepend, RedmineCategoryTree::Patches::IssueCategoriesControllerPatch)
end
require_dependency 'reports_controller'
unless ReportsController.included_modules.include?(RedmineCategoryTree::Patches::ReportsControllerPatch)
ReportsController.send(:prepend, RedmineCategoryTree::Patches::ReportsControllerPatch)
end
require_dependency 'context_menus_controller'
unless ContextMenusController.included_modules.include?(RedmineCategoryTree::Patches::ContextMenusControllerPatch)
ContextMenusController.send(:prepend, RedmineCategoryTree::Patches::ContextMenusControllerPatch)
end
end