Skip to content

Commit

Permalink
don't show admin account in members api
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 18, 2018
1 parent ee2e270 commit 169dfb2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ def query(query, options={})
must << { term: { region: options[:region].upcase }} if options[:region].present?
must << { term: { organization_type: options[:organization_type] }} if options[:organization_type].present?
must << { term: { focus_area: options[:focus_area] }} if options[:focus_area].present?
must << { term: { role_name: "ROLE_ALLOCATOR" }} unless options[:all_members]

if options[:all_members]
must << { terms: { role_name: %w(ROLE_ALLOCATOR ROLE_MEMBER) }}
else
must << { term: { role_name: "ROLE_ALLOCATOR" }}
end

must_not << { exists: { field: "deleted_at" }} unless options[:include_deleted]
elsif self.name == "Client"
must << { range: { created: { gte: "#{options[:year].split(",").min}||/y", lte: "#{options[:year].split(",").max}||/y", format: "yyyy" }}} if options[:year].present?
Expand Down

0 comments on commit 169dfb2

Please sign in to comment.