From 677f5c0e6ebc78341b27b67d8e882e0f52e36d67 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 30 Jan 2014 00:54:56 +0100 Subject: [PATCH] Moved to hash for user data. --- app/models/application_model/search_index_base.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/models/application_model/search_index_base.rb b/app/models/application_model/search_index_base.rb index b60b85c38..595a8717f 100644 --- a/app/models/application_model/search_index_base.rb +++ b/app/models/application_model/search_index_base.rb @@ -69,12 +69,16 @@ returns =end def search_index_data - data = [] + puts 'aaaaa' + + attributes = {} ['name', 'note'].each { |key| - data.push self[key] if self[key] + if self[key] && !self[key].empty? + attributes[key] = self[key] + end } - return data[0] if !data[1] - data + return if attributes.empty? + attributes end private