2020-05-14 14:08:06 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class DagJobEntity < Grape::Entity
|
|
|
|
expose :name
|
2020-05-21 02:08:25 -04:00
|
|
|
expose :scheduling_type
|
2020-05-14 14:08:06 -04:00
|
|
|
|
|
|
|
expose :needs, if: -> (job, _) { job.scheduling_type_dag? } do |job|
|
|
|
|
job.needs.pluck(:name) # rubocop: disable CodeReuse/ActiveRecord
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|