FIX: db:create was failing due to site settings
This commit is contained in:
parent
7f21892ad0
commit
54c0aa788c
|
@ -57,12 +57,12 @@ class SiteSettings::DbProvider
|
||||||
# table is not in the db yet, initial migration, etc
|
# table is not in the db yet, initial migration, etc
|
||||||
def table_exists?
|
def table_exists?
|
||||||
@table_exists ||= {}
|
@table_exists ||= {}
|
||||||
|
begin
|
||||||
unless @table_exists[current_site]
|
@table_exists[current_site] ||= ActiveRecord::Base.connection.table_exists?(@model.table_name)
|
||||||
@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
|
end
|
||||||
|
|
||||||
@table_exists[current_site]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue