The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
577 B

  1. # frozen_string_literal: true
  2. class UnblockDomainService < BaseService
  3. attr_accessor :domain_block
  4. def call(domain_block)
  5. @domain_block = domain_block
  6. process_retroactive_updates
  7. domain_block.destroy
  8. end
  9. def process_retroactive_updates
  10. scope = Account.by_domain_and_subdomains(domain_block.domain)
  11. scope.where(silenced_at: domain_block.created_at).in_batches.update_all(silenced_at: nil) unless domain_block.noop?
  12. scope.where(suspended_at: domain_block.created_at).in_batches.update_all(suspended_at: nil) if domain_block.suspend?
  13. end
  14. end