about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-08-07 17:08:30 +0200
committerGitHub <noreply@github.com>2019-08-07 17:08:30 +0200
commit94c54997cf6dc3bef2af67a070a61cc10595339c (patch)
treebffd958886fdd145c676af5bf78075e73fa1c4a1 /app/controllers
parent7a737c79cc06e931afef2eaebd971ea0324e0741 (diff)
Fix trending tags returning less items than requested sometimes (#11513)
Add better sorting defaults to the hashtags admin UI

Add "not reviewed" filter to hashtags admin UI
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/tags_controller.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb
index ed271aedc..794bb114a 100644
--- a/app/controllers/admin/tags_controller.rb
+++ b/app/controllers/admin/tags_controller.rb
@@ -36,9 +36,10 @@ module Admin
     def filtered_tags
       scope = Tag
       scope = scope.discoverable if filter_params[:context] == 'directory'
-      scope = scope.reviewed if filter_params[:review] == 'reviewed'
-      scope = scope.pending_review if filter_params[:review] == 'pending_review'
-      scope.reorder(score: :desc)
+      scope = scope.unreviewed if filter_params[:review] == 'unreviewed'
+      scope = scope.reviewed.order(reviewed_at: :desc) if filter_params[:review] == 'reviewed'
+      scope = scope.pending_review.order(requested_review_at: :desc) if filter_params[:review] == 'pending_review'
+      scope.order(score: :desc)
     end
 
     def filter_params