Eager load user, runner, pipeline and its creator

This commit is contained in:
Matija Čupić 2018-01-14 23:10:51 +01:00
parent c9a1a1552a
commit c9840842f1
No known key found for this signature in database
GPG key ID: 4BAF84FFACD2E5DE

View file

@ -35,7 +35,9 @@ module API
get ':id/builds' do
builds = user_project.builds.order('id DESC')
builds = filter_builds(builds, params[:scope])
present paginate(builds.includes(:job_artifacts_archive)), with: ::API::V3::Entities::Build
builds = builds.includes(:user, :job_artifacts_archive, :runner, pipeline: :project)
present paginate(builds), with: ::API::V3::Entities::Build
end
desc 'Get builds for a specific commit of a project' do