2018-07-19 14:43:13 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-03 08:55:14 -04:00
|
|
|
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
|