Rails5 Fix arel from

This commit is contained in:
Jasper Maes 2018-06-02 01:52:15 +02:00
parent f8bd8f4f06
commit a91999e4fa
2 changed files with 12 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
title: Rails5 fix arel from
merge_request: 19340
author: Jasper Maes
type: fixed

View file

@ -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')