about summary refs log tree commit diff
path: root/app/services/purge_domain_service.rb
blob: e10a8f0c868413e4f4fa4942d17021ff25293cea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

class PurgeDomainService < BaseService
  def call(domain)
    Account.remote.where(domain: domain).reorder(nil).find_each do |account|
      DeleteAccountService.new.call(account, reserve_username: false, skip_side_effects: true)
    end
    Instance.refresh
  end
end