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.

11 lines
379 B

  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