summaryrefslogtreecommitdiff
path: root/lib/gitlab/current_settings.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-01-23 16:58:13 +0100
committerRémy Coutable <remy@rymai.me>2017-01-23 16:58:13 +0100
commit765d57d6505b7fbd2542ee957d85399ebc74ba70 (patch)
tree2c7da0fd8325d06c196bc65157acebd3c34ebf11 /lib/gitlab/current_settings.rb
parent632c2939bb1e9d10b5e9be05bc4692d92f9f5f32 (diff)
downloadgitlab-ce-765d57d6505b7fbd2542ee957d85399ebc74ba70.tar.gz
Rescue from ActiveRecord::UnknownAttributeError and fallback to fake settingsdont-persist-application-settings-in-test-env-bis
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/gitlab/current_settings.rb')
-rw-r--r--lib/gitlab/current_settings.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index c79e17b57ee..4ebd48a3fc7 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -30,15 +30,15 @@ module Gitlab
end
def in_memory_application_settings
- @in_memory_application_settings ||= ApplicationSetting.new(ApplicationSetting::DEFAULTS)
+ @in_memory_application_settings ||= ::ApplicationSetting.new(::ApplicationSetting::DEFAULTS)
# In case migrations the application_settings table is not created yet,
# we fallback to a simple OpenStruct
- rescue ActiveRecord::StatementInvalid
+ rescue ActiveRecord::StatementInvalid, ActiveRecord::UnknownAttributeError
fake_application_settings
end
def fake_application_settings
- OpenStruct.new(ApplicationSetting::DEFAULTS)
+ OpenStruct.new(::ApplicationSetting::DEFAULTS)
end
private