Class: LabelsFinder

Inherits:
UnionFinder show all
Includes:
FinderMethods, Gitlab::Utils::StrongMemoize
Defined in:
app/finders/labels_finder.rb

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from FinderMethods

#find, #find_by, #find_by!

Methods inherited from UnionFinder

#find_union

Constructor Details

#initialize(current_user, params = {}) ⇒ LabelsFinder

Returns a new instance of LabelsFinder.


10
11
12
13
# File 'app/finders/labels_finder.rb', line 10

def initialize(current_user, params = {})
  @current_user = current_user
  @params = params
end

Instance Method Details

#execute(skip_authorization: false) ⇒ Object


15
16
17
18
19
20
21
22
# File 'app/finders/labels_finder.rb', line 15

def execute(skip_authorization: false)
  @skip_authorization = skip_authorization
  items = find_union(label_ids, Label) || Label.none
  items = with_title(items)
  items = by_subscription(items)
  items = by_search(items)
  sort(items)
end