From 26ff48ee48a5c03a2a4b0bd03fd322529e6bd960 Mon Sep 17 00:00:00 2001
From: Claire <claire.github-309c@sitedethib.com>
Date: Fri, 28 Oct 2022 20:14:25 +0200
Subject: Fix domain block export not exporting blocks with only media
 rejection

---
 app/models/domain_block.rb | 1 +
 1 file changed, 1 insertion(+)

(limited to 'app/models')

diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb
index ad1dc2a38..8e298ac9d 100644
--- a/app/models/domain_block.rb
+++ b/app/models/domain_block.rb
@@ -29,6 +29,7 @@ class DomainBlock < ApplicationRecord
 
   scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
   scope :with_user_facing_limitations, -> { where(severity: [:silence, :suspend]) }
+  scope :with_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), domain')) }
 
   def to_log_human_identifier
-- 
cgit