diff options
author | Sean McGivern <sean@gitlab.com> | 2017-08-30 13:30:12 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-08-30 13:30:12 +0300 |
commit | 07a7801c03ec6f5bccd517c38beaec426c554e11 (patch) | |
tree | a6a5aacf9761dc4805aa4f83c7241093917d3c2c | |
parent | 978b4b9cc0374c9cb5680612fe4154f393bbba9c (diff) |
Fix MySQL failure for emoji autocomplete
Postgres lets you treat `count` as another alias for `COUNT(*)` apparently, even
if that's not the actual alias used.
-rw-r--r-- | app/controllers/autocomplete_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb index 54f78fc8719..59be955599d 100644 --- a/app/controllers/autocomplete_controller.rb +++ b/app/controllers/autocomplete_controller.rb @@ -55,7 +55,7 @@ class AutocompleteController < ApplicationController .limit(AWARD_EMOJI_MAX) .where(user: current_user) .group(:name) - .order(count: :desc, name: :asc) + .order('count_all DESC, name ASC') .count # Transform from hash to array to guarantee json order |