Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed init.rb for Redmine 5.X #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions init.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -30,3 +21,4 @@
url 'https://github.com/preciousplum/custom_users_as_assignees'
author_url 'https://github.com/preciousplum/'
end