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

class UnblockDomainService < BaseService
  def call(domain_block, retroactive)
    if retroactive
      accounts = Account.where(domain: domain_block.domain).in_batches

      if domain_block.silence?
        accounts.update_all(silenced: false)
      else
        accounts.update_all(suspended: false)
      end
    end

    domain_block.destroy
  end
end