From ecb0ace02d2fbcd27f89f13765400dddc5d4b3dc Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 16 Aug 2015 11:24:15 +0200 Subject: [PATCH] Check if models_config exists to support migrations of existing systems. --- config/initializers/models_searchable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/models_searchable.rb b/config/initializers/models_searchable.rb index d57d805f7..2659b0943 100644 --- a/config/initializers/models_searchable.rb +++ b/config/initializers/models_searchable.rb @@ -2,7 +2,7 @@ if ActiveRecord::Base.connection.tables.include?('settings') models_current = Models.searchable.map(&:to_s) models_config = Setting.get('models_searchable') - if models_current != models_config + if models_config && models_current != models_config Setting.set('models_searchable', models_current) end end