mirror of
https://github.com/dolphin-emu/redmine_webhook.git
synced 2026-01-31 01:15:19 +01:00
Merge pull request #42 from yzzy/zeitwerk
Plugin autoloading with Zeitwerk
This commit is contained in:
8
init.rb
8
init.rb
@@ -1,4 +1,10 @@
|
||||
require 'redmine_webhook'
|
||||
if Rails.try(:autoloaders).try(:zeitwerk_enabled?)
|
||||
Rails.autoloaders.main.push_dir File.dirname(__FILE__) + '/lib/redmine_webhook'
|
||||
RedmineWebhook::ProjectsHelperPatch
|
||||
RedmineWebhook::WebhookListener
|
||||
else
|
||||
require "redmine_webhook"
|
||||
end
|
||||
|
||||
Redmine::Plugin.register :redmine_webhook do
|
||||
name 'Redmine Webhook plugin'
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
require 'redmine_webhook/projects_helper_patch'
|
||||
require 'redmine_webhook/issue_wrapper'
|
||||
require 'redmine_webhook/webhook_listener'
|
||||
unless Rails.try(:autoloaders).try(:zeitwerk_enabled?)
|
||||
require 'redmine_webhook/projects_helper_patch'
|
||||
require 'redmine_webhook/issue_wrapper'
|
||||
require 'redmine_webhook/webhook_listener'
|
||||
end
|
||||
|
||||
module RedmineWebhook
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ module RedmineWebhook
|
||||
:mail => @author.mail,
|
||||
:firstname => @author.firstname,
|
||||
:lastname => @author.lastname,
|
||||
:identity_url => @author.identity_url,
|
||||
:identity_url => @author.try(:identity_url),
|
||||
:icon_url => icon_url
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user