about summary refs log tree commit diff
path: root/app/models/domain_block.rb
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-09-30 16:38:09 -0700
committerReverite <github@reverite.sh>2019-09-30 16:38:09 -0700
commit01001ba118d7adcd4966c893cf95db32fe76c273 (patch)
treefc8b580c8f0a3c1e14a8ca20e3bea5bd7acb4ff1 /app/models/domain_block.rb
parent1e75b3d874973dd71ea74b158ebeb501d9ac68a3 (diff)
parent65db9df011a3e13efa79f4e56343aa69bdad7716 (diff)
Merge branch 'glitch' into production
Diffstat (limited to 'app/models/domain_block.rb')
-rw-r--r--app/models/domain_block.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb
index 4383cbd05..4e865b850 100644
--- a/app/models/domain_block.rb
+++ b/app/models/domain_block.rb
@@ -26,6 +26,7 @@ class DomainBlock < ApplicationRecord
 
   scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
   scope :with_user_facing_limitations, -> { where(severity: [:silence, :suspend]).or(where(reject_media: true)) }
+  scope :by_severity, -> { order(Arel.sql('(CASE severity WHEN 0 THEN 1 WHEN 1 THEN 2 WHEN 2 THEN 0 END), reject_media, domain')) }
 
   class << self
     def suspend?(domain)