FIX: Make `DbProvider#table_exits?` work with multisite.

This commit is contained in:
Guo Xiang Tan 2017-08-07 16:37:42 +09:00
parent f496302c2c
commit 22a1db7b8a
1 changed files with 7 additions and 2 deletions

View File

@ -56,8 +56,13 @@ class SiteSettings::DbProvider
# table is not in the db yet, initial migration, etc
def table_exists?
@table_exists = ActiveRecord::Base.connection.table_exists? @model.table_name unless @table_exists
@table_exists
@table_exists ||= {}
unless @table_exists[current_site]
@table_exists[current_site] = ActiveRecord::Base.connection.table_exists?(@model.table_name)
end
@table_exists[current_site]
end
end