Welcome to mirror list, hosted at ThFree Co, Russian Federation.

releases_actor_entity.rb « activity_pub « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c52741c73a57576b4318b850b8a4a1abaf194a85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module ActivityPub
  class ReleasesActorEntity < Grape::Entity
    include RequestAwareEntity

    expose :id do |project|
      project_releases_url(project)
    end

    expose :type do |*|
      "Application"
    end

    expose :path, as: :preferredUsername do |project|
      "#{project.path}-releases"
    end

    expose :name do |project|
      "#{_('Releases')} - #{project.name}"
    end

    expose :description, as: :content

    expose nil, using: ProjectEntity, as: :context do |project|
      project
    end
  end
end