diff options
author | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-06-02 02:52:15 +0300 |
---|---|---|
committer | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-06-02 16:00:51 +0300 |
commit | a91999e4faddbb5f5fc8e38548f4544ba6a41adf (patch) | |
tree | d9c5f104378bb7d9f8c8e5253a8b648b81b254df /lib/gitlab/database | |
parent | f8bd8f4f062e518ab855a83f38965df51ec3b073 (diff) |
Rails5 Fix arel from
Diffstat (limited to 'lib/gitlab/database')
-rw-r--r-- | lib/gitlab/database/median.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/gitlab/database/median.rb b/lib/gitlab/database/median.rb index 74fed447289..3cac007a42c 100644 --- a/lib/gitlab/database/median.rb +++ b/lib/gitlab/database/median.rb @@ -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') |