debian-mirror-gitlab/app/serializers/project_mirror_entity.rb
2018-11-18 11:00:15 +05:30

13 lines
296 B
Ruby

# 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