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
|
=end
|
||||||
|
|
||||||
def search_index_data
|
def search_index_data
|
||||||
data = []
|
attributes = { 'fullname' => "#{ self['firstname'] } #{ self['lastname'] }" }
|
||||||
data.push "#{ self['firstname'] } #{ self['lastname'] }"
|
|
||||||
['login', 'firstname', 'lastname', 'phone', 'email', 'city', 'country', 'note'].each { |key|
|
['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
|
||||||
end
|
end
|
Loading…
Reference in a new issue