From 16003ec1c32bf6e67056ea9da7274b2d71cb2c95 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 30 Jan 2014 00:51:30 +0100 Subject: [PATCH] Moved to hash for user data. --- app/models/user/search_index.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/user/search_index.rb b/app/models/user/search_index.rb index eb4b8a9c7..3254a3a5e 100644 --- a/app/models/user/search_index.rb +++ b/app/models/user/search_index.rb @@ -16,11 +16,13 @@ returns =end def search_index_data - data = [] - data.push "#{ self['firstname'] } #{ self['lastname'] }" + attributes = { 'fullname' => "#{ self['firstname'] } #{ self['lastname'] }" } ['login', 'firstname', 'lastname', 'phone', 'email', 'city', 'country', 'note'].each { |key| - data.push self[key] if self[key] + if self[key] && !self[key].empty? + attributes[key] = self[key] + end } - data + return if attributes.empty? + attributes end end \ No newline at end of file