summaryrefslogtreecommitdiff
path: root/app/serializers/project_mirror_entity.rb
blob: 8aba244cd11bb659681a573bae9c0ed900e7ff49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

class ProjectMirrorEntity < Grape::Entity
  expose :id

  expose :remote_mirrors_attributes do |project|
    next [] unless project.remote_mirrors.present?

    project.remote_mirrors.map do |remote|
      remote.as_json(only: %i[id url enabled])
    end
  end
end