FIX: db:create was failing due to site settings

This commit is contained in:
Sam 2018-06-07 14:51:00 +10:00
parent 7f21892ad0
commit 54c0aa788c
1 changed files with 5 additions and 5 deletions

View File

@ -57,12 +57,12 @@ class SiteSettings::DbProvider
# table is not in the db yet, initial migration, etc
def table_exists?
@table_exists ||= {}
unless @table_exists[current_site]
@table_exists[current_site] = ActiveRecord::Base.connection.table_exists?(@model.table_name)
begin
@table_exists[current_site] ||= ActiveRecord::Base.connection.table_exists?(@model.table_name)
rescue
STDERR.puts "No connection to db, unable to retrieve site settings! (normal when running db:create)"
@table_exists[current_site] = false
end
@table_exists[current_site]
end
end