diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-08 21:30:35 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-08 21:30:35 +0300 |
commit | 8133e44998236438c46e1b662bd284323287f415 (patch) | |
tree | 9521601b22e9653dc332f3357b0a63008dceecee | |
parent | 57a65ede77b7bbae6e3b2a7aa52135de7b0c2f8e (diff) |
Hack for migrating to new settings
-rw-r--r-- | config/initializers/8_application_settings.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/current_settings.rb | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/config/initializers/8_application_settings.rb b/config/initializers/8_application_settings.rb index c4706756b64..6f1dec7de09 100644 --- a/config/initializers/8_application_settings.rb +++ b/config/initializers/8_application_settings.rb @@ -1,4 +1,4 @@ -begin +if ActiveRecord::Base.connection.table_exists?('application_settings') unless ApplicationSetting.any? ApplicationSetting.create( default_projects_limit: Settings.gitlab['default_projects_limit'], @@ -8,5 +8,4 @@ begin sign_in_text: Settings.extra['sign_in_text'], ) end -rescue end diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb index 3467bb892fc..60efc70aa40 100644 --- a/lib/gitlab/current_settings.rb +++ b/lib/gitlab/current_settings.rb @@ -1,7 +1,17 @@ module Gitlab module CurrentSettings def current_application_settings - ApplicationSetting.current + if ActiveRecord::Base.connection.table_exists?('application_settings') + ApplicationSetting.current + else + OpenStruct.new( + default_projects_limit: Settings.gitlab['default_projects_limit'], + signup_enabled: Settings.gitlab['signup_enabled'], + signin_enabled: Settings.gitlab['signin_enabled'], + gravatar_enabled: Settings.gravatar['enabled'], + sign_in_text: Settings.extra['sign_in_text'], + ) + end end end end |