The code powering m.abunchtell.com https://m.abunchtell.com
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

16 rader
354 B

  1. # frozen_string_literal: true
  2. class BlockDomainService < BaseService
  3. def call(domain)
  4. DomainBlock.find_or_create_by!(domain: domain)
  5. Account.where(domain: domain).find_each do |account|
  6. if account.subscribed?
  7. account.subscription(api_subscription_url(account.id)).unsubscribe
  8. end
  9. account.destroy!
  10. end
  11. end
  12. end