Class: LabelsFinder

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

Instance Attribute Summary

Attributes included from FinderWithCrossProjectAccess

#should_skip_cross_project_check

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 included from FinderWithCrossProjectAccess

#can_read_cross_project?, #can_read_project?, #find, #find_by, #find_by!, #skip_cross_project_check

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods inherited from UnionFinder

#find_union

Constructor Details

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

Returns a new instance of LabelsFinder.


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

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

Instance Method Details

#execute(skip_authorization: false) ⇒ Object


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

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