-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.rb
38 lines (31 loc) · 1.09 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
require 'redmine'
require 'httparty'
require_dependency 'principal'
require_dependency 'user'
require_dependency 'issue'
require_dependency 'redmine_notifo/hooks/view_my_account_hook'
require_dependency 'notifo/notifo'
require 'dispatcher'
Dispatcher.to_prepare :redmine_notifo do
require_dependency 'principal'
require_dependency 'user'
# Guards against including the module multiple time (like in tests)
# and registering multiple callbacks
unless User.included_modules.include? RedmineNotifo::UserPatch
User.send(:include, RedmineNotifo::UserPatch)
end
require_dependency 'issue'
unless Issue.included_modules.include? RedmineNotifo::IssuePatch
Issue.send(:include, RedmineNotifo::IssuePatch)
end
ActiveRecord::Base.observers += [:notifo_journal_observer, :notifo_issue_observer]
end
Redmine::Plugin.register :redmine_notifo do
name 'Redmine Notifo plugin'
author 'Daniel Lehmann'
description 'Send notifo updates'
version '0.1.0'
url 'http://github.com/taktsoft/redmine_notifo'
author_url 'http://www.taktsoft.com'
requires_redmine :version_or_higher => '1.0.0'
end