search_index.rb 589 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Organization
  3. module SearchIndex
  4. extend ActiveSupport::Concern
  5. def search_index_attribute_lookup(include_references: true)
  6. attributes = super
  7. if include_references
  8. # add org members for search index data
  9. attributes['members'] = []
  10. users = members | secondary_members
  11. users.sort.each do |user|
  12. attributes['members'].push user.search_index_attribute_lookup(include_references: false)
  13. end
  14. end
  15. attributes
  16. end
  17. end
  18. end