summaryrefslogtreecommitdiff
path: root/app/serializers/discussion_serializer.rb
blob: 8bb7e93c0339ff014db6d3e4a9b2363fdca16df1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class DiscussionSerializer < BaseSerializer
  entity DiscussionEntity

  def represent(resource, opts = {}, entity_class = nil)
    super(resource, with_additional_opts(opts), entity_class)
  end

  private

  def with_additional_opts(opts)
    additional_opts = {
      submodule_links: Gitlab::SubmoduleLinks.new(@request.project.repository)
    }

    opts.merge(additional_opts)
  end
end