Commit c9840842 authored by Matija Čupić's avatar Matija Čupić

Eager load user, runner, pipeline and its creator

parent c9a1a155
...@@ -35,7 +35,9 @@ module API ...@@ -35,7 +35,9 @@ module API
get ':id/builds' do get ':id/builds' do
builds = user_project.builds.order('id DESC') builds = user_project.builds.order('id DESC')
builds = filter_builds(builds, params[:scope]) 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 end
desc 'Get builds for a specific commit of a project' do desc 'Get builds for a specific commit of a project' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment