about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-31 01:25:10 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-31 01:25:10 -0500
commit80a81fe223415525811c0c3ef62b8853624e9a6a (patch)
treea5438b0d28dd9a872ad0223b2a130dee59ab92b7 /app/services
parent964054b6dbabf119c9dea9cfa0b71011ace8df07 (diff)
ability to add domain moderation notes, edit existing domain policies in-place, and process asynchronously
Diffstat (limited to 'app/services')
-rw-r--r--app/services/block_domain_service.rb5
-rw-r--r--app/services/unblock_domain_service.rb4
2 files changed, 7 insertions, 2 deletions
diff --git a/app/services/block_domain_service.rb b/app/services/block_domain_service.rb
index 4a1218e3f..908deacf4 100644
--- a/app/services/block_domain_service.rb
+++ b/app/services/block_domain_service.rb
@@ -5,11 +5,16 @@ class BlockDomainService < BaseService
 
   def call(domain_block)
     @domain_block = domain_block
+    remove_existing_block!
     process_domain_block!
   end
 
   private
 
+  def remove_existing_block!
+    UnblockDomainService.new.call(@domain_block, false)
+  end
+
   def process_domain_block!
     clear_media! if domain_block.reject_media?
     force_accounts_sensitive! if domain_block.force_sensitive?
diff --git a/app/services/unblock_domain_service.rb b/app/services/unblock_domain_service.rb
index eceecd6d7..ab246203f 100644
--- a/app/services/unblock_domain_service.rb
+++ b/app/services/unblock_domain_service.rb
@@ -3,10 +3,10 @@
 class UnblockDomainService < BaseService
   attr_accessor :domain_block
 
-  def call(domain_block)
+  def call(domain_block, destroy_domain_block = true)
     @domain_block = domain_block
     process_retroactive_updates
-    domain_block.destroy
+    domain_block.destroy if destroy_domain_block
   end
 
   def process_retroactive_updates