1
0

purge_domain_service.rb 379 B

1234567891011
  1. # frozen_string_literal: true
  2. class PurgeDomainService < BaseService
  3. def call(domain)
  4. Account.remote.where(domain: domain).reorder(nil).find_each do |account|
  5. DeleteAccountService.new.call(account, reserve_username: false, skip_side_effects: true)
  6. end
  7. CustomEmoji.remote.where(domain: domain).reorder(nil).find_each(&:destroy)
  8. Instance.refresh
  9. end
  10. end