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
This commit is contained in:
Robert Speicher 2017-03-14 15:07:51 +00:00
commit bdc1a55ede
5 changed files with 6 additions and 13 deletions

View file

@ -1,5 +1,3 @@
require 'project_wiki'
class Projects::WikisController < Projects::ApplicationController
before_action :authorize_read_wiki!
before_action :authorize_create_wiki!, only: [:edit, :create, :history]

View file

@ -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)

View file

@ -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

View file

@ -1,5 +1,3 @@
require 'gitlab/o_auth/user'
# LDAP extension for User model
#
# * Find or create user from omniauth.auth data