From f1ad842aee5997052e99247c0af1931f2b72174d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 26 Sep 2015 17:59:58 +0200 Subject: [PATCH] Fixed initial setup. --- config/initializers/models_searchable.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/models_searchable.rb b/config/initializers/models_searchable.rb index f6fb4a24e..f91d6bae8 100644 --- a/config/initializers/models_searchable.rb +++ b/config/initializers/models_searchable.rb @@ -3,7 +3,8 @@ if ActiveRecord::Base.connection.tables.include?('settings') if Setting.columns_hash.key?('state_current') # TODO: remove me later models_current = Models.searchable.map(&:to_s) models_config = Setting.get('models_searchable') - if models_current != models_config + setting = Setting.find_by(name: 'models_searchable') + if setting && models_current != models_config Setting.set('models_searchable', models_current) end end