Commit 848ecbc7 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'rails5-fix-46281' into 'master'

Rails5 fix arel from

Closes #46281

See merge request gitlab-org/gitlab-ce!19340
parents 23ae072b a91999e4
---
title: Rails5 fix arel from
merge_request: 19340
author: Jasper Maes
type: fixed
...@@ -143,8 +143,13 @@ module Gitlab ...@@ -143,8 +143,13 @@ module Gitlab
.order(arel_table[column_sym]) .order(arel_table[column_sym])
).as('row_id') ).as('row_id')
count = arel_table.from(arel_table.alias) arel_from = if Gitlab.rails5?
.project('COUNT(*)') arel_table.from.from(arel_table.alias)
else
arel_table.from(arel_table.alias)
end
count = arel_from.project('COUNT(*)')
.where(arel_table[partition_column].eq(arel_table.alias[partition_column])) .where(arel_table[partition_column].eq(arel_table.alias[partition_column]))
.as('ct') .as('ct')
......
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