about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEmelia Smith <ThisIsMissEm@users.noreply.github.com>2018-04-23 21:27:18 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-04-23 21:27:18 +0200
commit495303d9b86919c72bf1948a714bf8d00b41fa0f (patch)
treeb8bc50013a96a73b63b3bd4e79b242cc4a75f3b6 /app/models
parent53b1d8887325160934dec7557e97a43ce2896264 (diff)
Prevent suspended accounts from appearing in AccountSearchService (#7246)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 0a4370be4..ee47f04af 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -117,6 +117,7 @@ class Account < ApplicationRecord
   scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) }
   scope :silenced, -> { where(silenced: true) }
   scope :suspended, -> { where(suspended: true) }
+  scope :without_suspended, -> { where(suspended: false) }
   scope :recent, -> { reorder(id: :desc) }
   scope :alphabetic, -> { order(domain: :asc, username: :asc) }
   scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') }