Moved to hash for user data.
This commit is contained in:
parent
67020df9d5
commit
16003ec1c3
1 changed files with 6 additions and 4 deletions
|
@ -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
|
Loading…
Reference in a new issue