debian-mirror-gitlab/app/services/issuable_links/list_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
602 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
module IssuableLinks
class ListService
include Gitlab::Routing
attr_reader :issuable, :current_user
def initialize(issuable, user)
2021-04-29 21:17:54 +05:30
@issuable = issuable
@current_user = user
2020-11-24 15:15:51 +05:30
end
def execute
2021-12-11 22:18:48 +05:30
serializer.new(current_user: current_user, issuable: issuable)
.represent(child_issuables, serializer_options)
2020-11-24 15:15:51 +05:30
end
private
2021-12-11 22:18:48 +05:30
def serializer_options
{}
end
2020-11-24 15:15:51 +05:30
def serializer
raise NotImplementedError
end
def preload_for_collection
[{ project: :namespace }, :assignees]
end
end
end