Commit 17de909a authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix broken grouping sql clause when rendering commits for CI

parent 59058a25
......@@ -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)
......
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