forked from southbridgeio/redmine_auto_percent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
26 lines (24 loc) · 896 Bytes
/
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
require 'redmine'
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 'issue'
# Guards against including the module multiple time (like in tests)
# and registering multiple callbacks
unless Issue.included_modules.include? RedmineAutoPercent::IssuePatch
Issue.send(:include, RedmineAutoPercent::IssuePatch)
end
end
Redmine::Plugin.register :redmine_auto_percent do
name 'Redmine Auto Done 100%'
author 'Wade Womersley / Agileware Inc.'
description 'Automatically sets 100% done on Resolved or Closed'
version '1.0.0'
url ''
author_url 'https://agileware.jp/'
end