diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-22 09:53:05 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-28 12:34:49 +0300 |
commit | 8e66618749613333c9201a6ffaf7fc67633cc055 (patch) | |
tree | ef102257e87a32c5c317a1202b0bc96858e831c1 /lib | |
parent | 2c3f3cb3920c5242cbc66456b3eed423636a2128 (diff) |
Find all builds for commit if multiple pipelines
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/builds.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/builds.rb b/lib/api/builds.rb index 979328efe0e..33aa86999f5 100644 --- a/lib/api/builds.rb +++ b/lib/api/builds.rb @@ -33,10 +33,10 @@ module API get ':id/repository/commits/:sha/builds' do authorize_read_builds! - commit = user_project.pipelines.find_by_sha(params[:sha]) - return not_found! unless commit + pipelines = user_project.pipelines.where(sha: params[:sha]) + return not_found! if pipelines.empty? - builds = commit.builds.order('id DESC') + builds = user_project.builds.where(pipeline: pipelines).order('id DESC') builds = filter_builds(builds, params[:scope]) present paginate(builds), with: Entities::Build, |