2020-05-24 23:13:21 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class DagJobEntity < Grape::Entity
|
|
|
|
expose :name
|
2020-06-23 00:09:42 +05:30
|
|
|
expose :scheduling_type
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
expose :needs, if: -> (job, _) { job.scheduling_type_dag? } do |job|
|
|
|
|
job.needs.pluck(:name) # rubocop: disable CodeReuse/ActiveRecord
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|