summaryrefslogtreecommitdiff
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
parent632c2939bb1e9d10b5e9be05bc4692d92f9f5f32 (diff)
downloadgitlab-ce-dont-persist-application-settings-in-test-env-bis.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>
-rw-r--r--lib/gitlab/current_settings.rb6
-rw-r--r--lib/gitlab/import_sources.rb2
2 files changed, 3 insertions, 5 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
diff --git a/lib/gitlab/import_sources.rb b/lib/gitlab/import_sources.rb
index 45958710c13..52276cbcd9a 100644
--- a/lib/gitlab/import_sources.rb
+++ b/lib/gitlab/import_sources.rb
@@ -5,8 +5,6 @@
#
module Gitlab
module ImportSources
- extend CurrentSettings
-
ImportSource = Struct.new(:name, :title, :importer)
ImportTable = [