From 70ce031d24e2972d01635864417dc09f154f13d2 Mon Sep 17 00:00:00 2001 From: Henry Glueck Date: Tue, 25 Jul 2023 15:14:11 +0200 Subject: [PATCH] Fixed init.rb for Redmine 5.X --- init.rb | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/init.rb b/init.rb index 2b7da04..cf83bcc 100644 --- a/init.rb +++ b/init.rb @@ -1,25 +1,16 @@ -require 'redmine' -Rails.configuration.to_prepare do - require_dependency 'project' - require_dependency 'principal' - require_dependency 'user' - require_dependency 'issue' - require_dependency 'issue_query' - require_dependency 'mailer' - - unless Issue.included_modules.include? CustomUsersAsAssignees::IssuePatch - Issue.send :include, CustomUsersAsAssignees::IssuePatch - end - unless User.included_modules.include? CustomUsersAsAssignees::UserPatch - User.send :include, CustomUsersAsAssignees::UserPatch - end - unless IssueQuery.included_modules.include? CustomUsersAsAssignees::IssueQueryPatch - IssueQuery.send :include, CustomUsersAsAssignees::IssueQueryPatch - end - unless Mailer.included_modules.include? CustomUsersAsAssignees::MailerPatch - Mailer.send :include, CustomUsersAsAssignees::MailerPatch - end +require File.expand_path('lib/custom_users_as_assignees', __dir__) +unless Issue.included_modules.include? CustomUsersAsAssignees::IssuePatch + Issue.send :include, CustomUsersAsAssignees::IssuePatch +end +unless User.included_modules.include? CustomUsersAsAssignees::UserPatch + User.send :include, CustomUsersAsAssignees::UserPatch +end +unless IssueQuery.included_modules.include? CustomUsersAsAssignees::IssueQueryPatch + IssueQuery.send :include, CustomUsersAsAssignees::IssueQueryPatch +end +unless Mailer.included_modules.include? CustomUsersAsAssignees::MailerPatch + Mailer.send :include, CustomUsersAsAssignees::MailerPatch end Redmine::Plugin.register :custom_users_as_assignees do @@ -30,3 +21,4 @@ url 'https://github.com/preciousplum/custom_users_as_assignees' author_url 'https://github.com/preciousplum/' end +