From 3b276d268f8e49b897f16f490c78a5a5880c6216 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 30 Aug 2019 22:03:46 -0500 Subject: use a scheduled task to batch domain policy changes + revert `29643fd6` to avoid accidentally dosing servers when multiple users block a domain --- app/models/domain_block.rb | 2 ++ app/models/status.rb | 1 + 2 files changed, 3 insertions(+) (limited to 'app/models') diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb index 7d3b65720..478095cb0 100644 --- a/app/models/domain_block.rb +++ b/app/models/domain_block.rb @@ -13,6 +13,7 @@ # force_sensitive :boolean default(FALSE), not null # reason :text # reject_unknown :boolean default(FALSE), not null +# processing :boolean default(TRUE), not null # class DomainBlock < ApplicationRecord @@ -26,6 +27,7 @@ class DomainBlock < ApplicationRecord delegate :count, to: :accounts, prefix: true scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) } + scope :unprocessed, -> { where(processing: true) } def self.blocked?(domain) where(domain: domain, severity: :suspend).exists? diff --git a/app/models/status.rb b/app/models/status.rb index 0be747b00..afd25c808 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -31,6 +31,7 @@ # edited :boolean # imported :boolean # origin :string +# tsv :tsvector # boostable :boolean # reject_replies :boolean # -- cgit