The code powering m.abunchtell.com https://m.abunchtell.com
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

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