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
This commit is contained in:
parent
7a737c79cc
commit
94c54997cf
5 changed files with 13 additions and 8 deletions
|
@ -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')) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue