about summary refs log tree commit diff
path: root/app/models/tag.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-08-07 13:56:48 +0200
committerThibaut Girka <thib@sitedethib.com>2019-08-07 13:56:48 +0200
commit04534604c654060eca24628247fdb51b7ff5372a (patch)
treef8ae222e84056fb2674d23187e66517da1fc2af9 /app/models/tag.rb
parent8400ddca7155005ab79485ed6054c04ea3ca5667 (diff)
parentac33f1aedd9a6c72c6c176afb1f5d62a1ce5d44d (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/models/user.rb
- app/serializers/initial_state_serializer.rb
- app/views/admin/dashboard/index.html.haml
- config/locales/simple_form.en.yml
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 6a02581fa..e2fe91da1 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -31,7 +31,8 @@ class Tag < ApplicationRecord
 
   scope :reviewed, -> { where.not(reviewed_at: nil) }
   scope :pending_review, -> { where(reviewed_at: nil).where.not(requested_review_at: nil) }
-  scope :discoverable, -> { where.not(listable: false).joins(:account_tag_stat).where(AccountTagStat.arel_table[:accounts_count].gt(0)).order(Arel.sql('account_tag_stats.accounts_count desc')) }
+  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')) }
 
   delegate :accounts_count,