forked from a1exsh/redmine_silencer
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinit.rb
26 lines (21 loc) · 751 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'
Redmine::Plugin.register :redmine_silencer do
name 'Redmine Silencer plugin'
author 'Alex Shulgin <ash@commandprompt.com>'
description 'A Redmine plugin to suppress issue email notifications.'
version '0.2.0'
url 'https://github.com/commandprompt/redmine_silencer'
requires_redmine :version_or_higher => '2.0.x'
permission :suppress_mail_notifications, {}
end
prepare_block = Proc.new do
Journal.send(:include, RedmineSilencer::JournalPatch)
JournalObserver.send(:include, RedmineSilencer::JournalObserverPatch)
end
if Rails.env.development?
ActionDispatch::Reloader.to_prepare { prepare_block.call }
else
prepare_block.call
end
require 'redmine_silencer/issue_hooks'
require 'redmine_silencer/view_hooks'