mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 14:46:05 +10:00
Rescue missing database errors
While loading the Rails app we cannot assume that the gitlabhq_xxx database exists already. If we do, `rake gitlab:setup` breaks! This is a quick hack to make sure that fresh development setups of GitLab (from master) will work again.
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
module Gitlab
|
||||
module CurrentSettings
|
||||
def current_application_settings
|
||||
if ActiveRecord::Base.connection.table_exists?('application_settings')
|
||||
ApplicationSetting.current ||
|
||||
ApplicationSetting.create_from_defaults
|
||||
else
|
||||
begin
|
||||
if ActiveRecord::Base.connection.table_exists?('application_settings')
|
||||
ApplicationSetting.current ||
|
||||
ApplicationSetting.create_from_defaults
|
||||
else
|
||||
fake_application_settings
|
||||
end
|
||||
rescue ActiveRecord::NoDatabaseError
|
||||
fake_application_settings
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user