diff options
author | Robert Speicher <robert@gitlab.com> | 2017-03-14 15:07:51 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-03-14 15:07:51 +0000 |
commit | bdc1a55eded1f60900fe89591a7fb935445eaac6 (patch) | |
tree | a1046d63a6917cbcfb8e3b2e47ec016822ea2bd7 /config | |
parent | 8f66751179bf97d92fa0b9e85fd5336b40f990ea (diff) | |
parent | c5e34da01d6ef4717f934754c9c2d1beadd8c55e (diff) | |
download | gitlab-ce-bdc1a55eded1f60900fe89591a7fb935445eaac6.tar.gz |
Merge branch '29389-fix-already-initialized-constants' into 'master'
Remove explicit `require` calls, and use `require_dependency` when needed
Closes #29389
See merge request !9899
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/8_metrics.rb | 6 | ||||
-rw-r--r-- | config/initializers/omniauth.rb | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index 3e1657b8382..5e0eefdb154 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -124,9 +124,9 @@ if Gitlab::Metrics.enabled? # These are manually require'd so the classes are registered properly with # ActiveSupport. - require 'gitlab/metrics/subscribers/action_view' - require 'gitlab/metrics/subscribers/active_record' - require 'gitlab/metrics/subscribers/rails_cache' + require_dependency 'gitlab/metrics/subscribers/action_view' + require_dependency 'gitlab/metrics/subscribers/active_record' + require_dependency 'gitlab/metrics/subscribers/rails_cache' Gitlab::Application.configure do |config| config.middleware.use(Gitlab::Metrics::RackMiddleware) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index ab5a0561b8c..f7fa6d1c2de 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -20,15 +20,12 @@ OmniAuth.config.before_request_phase do |env| end if Gitlab.config.omniauth.enabled - Gitlab.config.omniauth.providers.each do |provider| - if provider['name'] == 'kerberos' - require 'omniauth-kerberos' - end - end + provider_names = Gitlab.config.omniauth.providers.map(&:name) + require 'omniauth-kerberos' if provider_names.include?('kerberos') end module OmniAuth module Strategies - autoload :Bitbucket, Rails.root.join('lib', 'omniauth', 'strategies', 'bitbucket') + autoload :Bitbucket, Rails.root.join('lib', 'omni_auth', 'strategies', 'bitbucket') end end |