diff --git a/init.rb b/init.rb index 2f8a8a9..448c8b9 100644 --- a/init.rb +++ b/init.rb @@ -1,8 +1,13 @@ require 'redmine' -# Patches to the Redmine core. Will not work in development mode -require_dependency 'issue_patch' -require_dependency 'query_patch' +# Patches to the Redmine core. +require 'dispatcher' +require 'issue_patch' +require 'query_patch' +Dispatcher.to_prepare do + Issue.send(:include, IssuePatch) + Query.send(:include, QueryPatch) +end # Hooks require_dependency 'budget_issue_hook' diff --git a/lib/issue_patch.rb b/lib/issue_patch.rb index 1722ed6..76aa2ea 100644 --- a/lib/issue_patch.rb +++ b/lib/issue_patch.rb @@ -32,7 +32,4 @@ module IssuePatch end end -# Add module to Issue -Issue.send(:include, IssuePatch) - diff --git a/lib/query_patch.rb b/lib/query_patch.rb index a17271f..db1d821 100644 --- a/lib/query_patch.rb +++ b/lib/query_patch.rb @@ -50,7 +50,4 @@ module QueryPatch end end -# Add module to Query -Query.send(:include, QueryPatch) -