From 22a1db7b8ac38617cbee481311449858cf926feb Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 7 Aug 2017 16:37:42 +0900 Subject: [PATCH] FIX: Make `DbProvider#table_exits?` work with multisite. --- lib/site_settings/db_provider.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/site_settings/db_provider.rb b/lib/site_settings/db_provider.rb index 4410e05eeef..8aef485c933 100644 --- a/lib/site_settings/db_provider.rb +++ b/lib/site_settings/db_provider.rb @@ -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