summaryrefslogtreecommitdiff
path: root/app/controllers/ci
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-06 16:25:27 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-06 16:25:27 +0200
commit17de909a42fa5d641eb9554e94fee59fb0762cbc (patch)
treea29f1502422e52e373b077b515123f556f3489fb /app/controllers/ci
parent59058a25434ae9fc39da63f7501ddf2a31c80f7b (diff)
downloadgitlab-ce-17de909a42fa5d641eb9554e94fee59fb0762cbc.tar.gz
Fix broken grouping sql clause when rendering commits for CI
Diffstat (limited to 'app/controllers/ci')
-rw-r--r--app/controllers/ci/projects_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb
index 64d544acfd9..adb913a783f 100644
--- a/app/controllers/ci/projects_controller.rb
+++ b/app/controllers/ci/projects_controller.rb
@@ -14,9 +14,10 @@ module Ci
def show
@ref = params[:ref]
- @commits = @project.commits.group(:sha).reverse_order
+ @commits = @project.commits.reverse_order
if @ref
- builds = @project.builds.where(ref: @ref).select(:commit_id).distinct
+ # unscope is required, because of default_scope defined in Ci::Build
+ builds = @project.builds.unscope(:select, :order).where(ref: @ref).select(:commit_id).distinct
@commits = @commits.where(id: builds)
end
@commits = @commits.page(params[:page]).per(20)