diff options
author | ThibG <thib@sitedethib.com> | 2019-08-08 09:25:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-08 09:25:00 +0200 |
commit | aa485d6f055b93fd7a9df8b47ed96122b38af39e (patch) | |
tree | c0a0bab3b7006e00b2a0881460d14fb7bd24c4aa /app/models/tag.rb | |
parent | 86cfa2ea6cb94c9597b9fcda034c8b4d959c5e3e (diff) | |
parent | 9b8edbea5b3f0e7690c645502a0f1dcd22fb8737 (diff) |
Merge pull request #1194 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/tag.rb')
-rw-r--r-- | app/models/tag.rb | 3 |
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')) } |