gitlab-org--gitlab-foss/app/serializers/ci/dag_job_entity.rb

13 lines
286 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Ci
class DagJobEntity < Grape::Entity
expose :name
expose :scheduling_type
expose :needs, if: -> (job, _) { job.scheduling_type_dag? } do |job|
job.needs.pluck(:name) # rubocop: disable CodeReuse/ActiveRecord
end
end
end