diff options
author | ThibG <thib@sitedethib.com> | 2019-09-30 23:29:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-30 23:29:55 +0200 |
commit | 65db9df011a3e13efa79f4e56343aa69bdad7716 (patch) | |
tree | 1941b85de1f0d1b6f56b73345cddf664a71faf20 /app/models/domain_block.rb | |
parent | febcdad2e2c98aee62b55ee21bdf0debf7c6fd6b (diff) | |
parent | 3b855b5c82362783969f748ad78bcaf85f938c9f (diff) |
Merge pull request #1224 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/domain_block.rb')
-rw-r--r-- | app/models/domain_block.rb | 1 |
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) |