about summary refs log tree commit diff
path: root/app/services/unblock_domain_service.rb
blob: 9794e439d14421d02cf1d308b5867efccccc0433 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class UnblockDomainService < BaseService
  def call(domain_block, retroactive)
    if retroactive
      if domain_block.silence?
        Account.where(domain: domain_block.domain).update_all(silenced: false)
      else
        Account.where(domain: domain_block.domain).update_all(suspended: false)
      end
    end

    domain_block.destroy
  end
end