summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-08-30 11:30:12 +0100
committerSean McGivern <sean@gitlab.com>2017-08-30 11:30:12 +0100
commit07a7801c03ec6f5bccd517c38beaec426c554e11 (patch)
treea6a5aacf9761dc4805aa4f83c7241093917d3c2c
parent978b4b9cc0374c9cb5680612fe4154f393bbba9c (diff)
downloadgitlab-ce-07a7801c03ec6f5bccd517c38beaec426c554e11.tar.gz
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.rb2
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