summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-21 08:10:25 +0000
committerRémy Coutable <remy@rymai.me>2017-06-21 08:10:25 +0000
commit6ea24e9933654049525418a093cf85e375144113 (patch)
treedaab6f31b077cc04c9a2debb744799dbd74688fb
parentf3b01fc2e6e2862043fff5e23d57e34beca2f830 (diff)
parent03e538b7210dabb01a1e8dc225d6e364e277a7a0 (diff)
downloadgitlab-ce-6ea24e9933654049525418a093cf85e375144113.tar.gz
Merge branch 'sh-current-settings-autoload-fix' into 'master'
Change references from ApplicationSetting to ::ApplicationSetting to make autoload happier Closes #34047 See merge request !12331
-rw-r--r--lib/gitlab/current_settings.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index 284e6ad55a5..818b3d9c46b 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -10,7 +10,7 @@ module Gitlab
delegate :sidekiq_throttling_enabled?, to: :current_application_settings
- def fake_application_settings(defaults = ApplicationSetting.defaults)
+ def fake_application_settings(defaults = ::ApplicationSetting.defaults)
FakeApplicationSettings.new(defaults)
end
@@ -24,7 +24,7 @@ module Gitlab
def cached_application_settings
begin
- ApplicationSetting.cached
+ ::ApplicationSetting.cached
rescue ::Redis::BaseError, ::Errno::ENOENT
# In case Redis isn't running or the Redis UNIX socket file is not available
end
@@ -35,7 +35,7 @@ module Gitlab
# This loads from the database into the cache, so handle Redis errors
begin
- db_settings = ApplicationSetting.current
+ db_settings = ::ApplicationSetting.current
rescue ::Redis::BaseError, ::Errno::ENOENT
# In case Redis isn't running or the Redis UNIX socket file is not available
end
@@ -45,14 +45,14 @@ module Gitlab
# and other callers from failing, use any loaded settings and return
# defaults for missing columns.
if ActiveRecord::Migrator.needs_migration?
- defaults = ApplicationSetting.defaults
+ defaults = ::ApplicationSetting.defaults
defaults.merge!(db_settings.attributes.symbolize_keys) if db_settings.present?
return fake_application_settings(defaults)
end
return db_settings if db_settings.present?
- ApplicationSetting.create_from_defaults || in_memory_application_settings
+ ::ApplicationSetting.create_from_defaults || in_memory_application_settings
end
def in_memory_application_settings