search_index.rb 628 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. class Organization
  3. module SearchIndex
  4. =begin
  5. lookup name of ref. objects
  6. organization = Organization.find(123)
  7. attributes = organization.search_index_attribute_lookup
  8. returns
  9. attributes # object with lookup data
  10. =end
  11. def search_index_attribute_lookup
  12. attributes = super
  13. # add org members for search index data
  14. attributes['members'] = []
  15. users = User.where(organization_id: id)
  16. users.each do |user|
  17. attributes['members'].push user.search_index_data
  18. end
  19. attributes
  20. end
  21. end
  22. end