Commit bc95576e authored by Jacob Vosmaer's avatar Jacob Vosmaer

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.
parent d531de0b
module Gitlab module Gitlab
module CurrentSettings module CurrentSettings
def current_application_settings def current_application_settings
begin
if ActiveRecord::Base.connection.table_exists?('application_settings') if ActiveRecord::Base.connection.table_exists?('application_settings')
ApplicationSetting.current || ApplicationSetting.current ||
ApplicationSetting.create_from_defaults ApplicationSetting.create_from_defaults
else else
fake_application_settings fake_application_settings
end end
rescue ActiveRecord::NoDatabaseError
fake_application_settings
end
end end
def fake_application_settings def fake_application_settings
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment