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

class UnallowDomainService < BaseService
  def call(domain_allow)
    Account.where(domain: domain_allow.domain).find_each do |account|
      SuspendAccountService.new.call(account, destroy: true)
    end

    domain_allow.destroy
  end
end