diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-23 18:58:13 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-23 18:58:13 +0300 |
commit | 765d57d6505b7fbd2542ee957d85399ebc74ba70 (patch) | |
tree | 2c7da0fd8325d06c196bc65157acebd3c34ebf11 /lib/gitlab | |
parent | 632c2939bb1e9d10b5e9be05bc4692d92f9f5f32 (diff) |
Rescue from ActiveRecord::UnknownAttributeError and fallback to fake settings
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/current_settings.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/import_sources.rb | 2 |
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 = [ |