Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-08-30 13:30:12 +0300
committerSean McGivern <sean@gitlab.com>2017-08-30 13:30:12 +0300
commit07a7801c03ec6f5bccd517c38beaec426c554e11 (patch)
treea6a5aacf9761dc4805aa4f83c7241093917d3c2c /app/controllers/autocomplete_controller.rb
parent978b4b9cc0374c9cb5680612fe4154f393bbba9c (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.
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-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