The code powering m.abunchtell.com https://m.abunchtell.com
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

16 lignes
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