about summary refs log tree commit diff
path: root/app/services/purge_domain_service.rb
blob: 9df81f13e66be0abd4d0ecbe04312deefec1134f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
# 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
    CustomEmoji.remote.where(domain: domain).reorder(nil).find_each(&:destroy)
    Instance.refresh
  end
end