about summary refs log tree commit diff
path: root/app/models/tag.rb
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/models/tag.rb
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/models/tag.rb')
-rw-r--r--app/models/tag.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb
index e2fe91da1..1364d1dba 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -30,7 +30,8 @@ class Tag < ApplicationRecord
   validate :validate_name_change, if: -> { !new_record? && name_changed? }
 
   scope :reviewed, -> { where.not(reviewed_at: nil) }
-  scope :pending_review, -> { where(reviewed_at: nil).where.not(requested_review_at: nil) }
+  scope :unreviewed, -> { where(reviewed_at: nil) }
+  scope :pending_review, -> { unreviewed.where.not(requested_review_at: nil) }
   scope :usable, -> { where(usable: [true, nil]) }
   scope :discoverable, -> { where(listable: [true, nil]).joins(:account_tag_stat).where(AccountTagStat.arel_table[:accounts_count].gt(0)).order(Arel.sql('account_tag_stats.accounts_count desc')) }
   scope :most_used, ->(account) { joins(:statuses).where(statuses: { account: account }).group(:id).order(Arel.sql('count(*) desc')) }