debian-mirror-gitlab/app/serializers/project_mirror_entity.rb

12 lines
265 B
Ruby
Raw Normal View History

2018-10-15 14:42:47 +05:30
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