Load 'Gitlab::Jira::Middleware' if it exists

Loads 'Gitlab::Jira::Middleware' only if it exists
so this initializer can be backported to CE.
This commit is contained in:
Felipe Artur 2019-04-01 08:55:52 +00:00 committed by Rémy Coutable
parent 093629fedc
commit 0a6478d159
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
# Changes JIRA DVCS user agent requests in order to be successfully handled
# by our API.
#
# Gitlab::Jira::Middleware is only defined on EE
#
# Use safe_constantize because the class may exist but has not been loaded yet
if "Gitlab::Jira::Middleware".safe_constantize
Rails.application.config.middleware.use(Gitlab::Jira::Middleware)
end