Class: Issuables::AssigneeFilter

Inherits:
BaseFilter show all
Defined in:
app/finders/issuables/assignee_filter.rb

Constant Summary

Constants inherited from BaseFilter

BaseFilter::FILTER_ANY, BaseFilter::FILTER_NONE

Instance Attribute Summary

Attributes inherited from BaseFilter

#params

Instance Method Summary collapse

Methods inherited from BaseFilter

#initialize

Constructor Details

This class inherits a constructor from Issuables::BaseFilter

Instance Method Details

#filter(issuables) ⇒ Object


5
6
7
8
9
# File 'app/finders/issuables/assignee_filter.rb', line 5

def filter(issuables)
  filtered = by_assignee(issuables)
  filtered = by_assignee_union(filtered)
  by_negated_assignee(filtered)
end

#includes_user?(user) ⇒ Boolean

Returns:

  • (Boolean)

11
12
13
14
15
# File 'app/finders/issuables/assignee_filter.rb', line 11

def includes_user?(user)
  Array(params[:assignee_ids]).include?(user.id) ||
    Array(params[:assignee_id]).include?(user.id) ||
    Array(params[:assignee_username]).include?(user.username)
end