-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
32 lines (27 loc) · 1.1 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
require 'redmine'
require 'dispatcher'
require 'time_entries_query_patch'
unless Redmine::Plugin.registered_plugins.keys.include?(:time_entries_query_operators)
Redmine::Plugin.register :time_entries_query_operators do
name 'Time entries query operators plugin'
author 'Nikita Vasiliev'
author_url 'mailto:[email protected]'
description 'Redmine plugin which add filters by time_entries'
version '0.0.3'
requires_redmine :version_or_higher => '1.3.0'
end
end
Dispatcher.to_prepare :time_entries_query_operators do
require_dependency 'issue'
require_dependency 'time_entry'
require_dependency 'query'
unless Issue.included_modules.include? TimeEntryQuery::Patches::IssueModelPatch
Issue.send(:include, TimeEntryQuery::Patches::IssueModelPatch)
end
unless TimeEntry.included_modules.include? TimeEntryQuery::Patches::TimeEntryModelPatch
TimeEntry.send(:include, TimeEntryQuery::Patches::TimeEntryModelPatch)
end
unless Query.included_modules.include? TimeEntryQuery::Patches::QueryModelPatch
Query.send(:include, TimeEntryQuery::Patches::QueryModelPatch)
end
end