Rails5 Fix arel from
This commit is contained in:
parent
f8bd8f4f06
commit
a91999e4fa
2 changed files with 12 additions and 2 deletions
5
changelogs/unreleased/rails5-fix-46281.yml
Normal file
5
changelogs/unreleased/rails5-fix-46281.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Rails5 fix arel from
|
||||
merge_request: 19340
|
||||
author: Jasper Maes
|
||||
type: fixed
|
|
@ -143,8 +143,13 @@ module Gitlab
|
|||
.order(arel_table[column_sym])
|
||||
).as('row_id')
|
||||
|
||||
count = arel_table.from(arel_table.alias)
|
||||
.project('COUNT(*)')
|
||||
arel_from = if Gitlab.rails5?
|
||||
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]))
|
||||
.as('ct')
|
||||
|
||||
|
|
Loading…
Reference in a new issue