DEV: Remove useless ORDER clause (#12247)

These results are combined with others and then ordered in Ruby.
This commit is contained in:
Bianca Nenciu 2021-03-02 02:55:07 +02:00 committed by GitHub
parent 6b4d066834
commit 6f0397fba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,7 +142,6 @@ class UserSummary
.merge(Topic.listable_topics.visible.secured(@guardian))
.where(user: @user)
.group('topics.category_id')
.order('COUNT(*) DESC')
top_categories = {}
@ -168,7 +167,6 @@ class UserSummary
.where('topics.category_id in (?)', top_categories.keys)
.where(user: @user)
.group('topics.category_id')
.order('COUNT(*) DESC')
.pluck('category_id, COUNT(*)')
.each do |r|
top_categories[r[0].to_i].topic_count = r[1]