Class: Groups::CustomEmojiFinder

Inherits:
Base
  • Object
show all
Includes:
FinderWithGroupHierarchy, Gitlab::Utils::StrongMemoize
Defined in:
app/finders/groups/custom_emoji_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(group, params = {}) ⇒ CustomEmojiFinder

Returns a new instance of CustomEmojiFinder.



8
9
10
11
12
# File 'app/finders/groups/custom_emoji_finder.rb', line 8

def initialize(group, params = {})
  @group = group
  @params = params
  @skip_authorization = true
end

Instance Method Details

#executeObject



14
15
16
17
18
# File 'app/finders/groups/custom_emoji_finder.rb', line 14

def execute
  return CustomEmoji.for_resource(group) unless params[:include_ancestor_groups]

  CustomEmoji.for_namespaces(group_ids_for(group))
end