forked from giddie/redmine_default_assign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
45 lines (40 loc) · 1.76 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
require 'redmine'
# Including dispatcher.rb in case of Rails 2.x
require 'dispatcher' unless Rails::VERSION::MAJOR >= 3
require './plugins/redmine_default_assign/lib/default_assign_issue_patch'
require './plugins/redmine_default_assign/lib/default_assign_project_patch'
require './plugins/redmine_default_assign/lib/default_assign/hooks/default_assign_projects_hooks'
require './plugins/redmine_default_assign/lib/default_assign/hooks/default_assign_issues_hooks'
if Rails::VERSION::MAJOR >= 3
register_after_redmine_initialize_proc =
if Redmine::VERSION::MAJOR >= 5
Rails.application.config.public_method(:after_initialize)
else
reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader
reloader.public_method(:to_prepare)
end
register_after_redmine_initialize_proc.call do
require_dependency 'project'
require_dependency 'issue'
Project.send(:include, DefaultAssignProjectPatch)
Issue.send(:include, DefaultAssignIssuePatch)
end
else
Dispatcher.to_prepare do
require_dependency 'project'
require_dependency 'issue'
Project.send(:include, DefaultAssignProjectPatch)
Issue.send(:include, DefaultAssignIssuePatch)
end
end
Redmine::Plugin.register :redmine_default_assign do
name 'Default Assign plugin'
author 'Robert Chady / Paul Dann'
author_url 'https://github.com/giddie/redmine_default_assign'
description 'Plugin implementing Douglas Campos\' ticket-482 code as a plugin. It has since been extended to offer other features as well.'
version '0.6'
settings :default => {'default_assignee_id' => nil,
'interactive_assignment' => true,
'self_assignment' => false},
:partial => 'settings/default_assign'
end