123456789101112131415161718192021222324252627282930 |
- class User
- module SearchIndex
- def search_index_data
- attributes = { 'fullname' => "#{ self['firstname'] } #{ self['lastname'] }" }
- %w(login firstname lastname phone email address city country note created_at).each { |key|
- if self[key] && (!self.respond_to?('empty?') || !self[key].empty?)
- attributes[key] = self[key]
- end
- }
- return if attributes.empty?
- attributes
- end
- end
- end
|