Commit a91999e4 authored by Jasper Maes's avatar Jasper Maes

Rails5 Fix arel from

parent f8bd8f4f
---
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