diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-06 17:25:27 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-06 17:25:27 +0300 |
commit | 17de909a42fa5d641eb9554e94fee59fb0762cbc (patch) | |
tree | a29f1502422e52e373b077b515123f556f3489fb /app/controllers/ci | |
parent | 59058a25434ae9fc39da63f7501ddf2a31c80f7b (diff) |
Fix broken grouping sql clause when rendering commits for CI
Diffstat (limited to 'app/controllers/ci')
-rw-r--r-- | app/controllers/ci/projects_controller.rb | 5 |
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) |