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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
415 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Ci
class DagPipelineEntity < Grape::Entity
expose :stages_with_preloads, as: :stages, using: Ci::DagStageEntity
private
def stages_with_preloads
object.stages.preload(preloaded_relations) # rubocop: disable CodeReuse/ActiveRecord
end
def preloaded_relations
[
:project,
{ latest_statuses: :needs }
]
end
end
end