about summary refs log tree commit diff
path: root/app/models/domain_block.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-09-19 11:09:05 +0200
committerGitHub <noreply@github.com>2019-09-19 11:09:05 +0200
commitd930eb88b671fa6e5573fe7342bcdda87501bdb7 (patch)
treea67ab76528da0060e7def3d13f5802904d215939 /app/models/domain_block.rb
parente1066cd4319a220d5be16e51ffaf5236a2f6e866 (diff)
Add table of contents to about page (#11885)
Move public domain blocks information to about page
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)