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 CurrentSettings
def current_application_settings
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
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