about summary refs log tree commit diff
path: root/app/services/unallow_domain_service.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-07-30 12:22:33 +0200
committerThibaut Girka <thib@sitedethib.com>2019-07-30 12:22:33 +0200
commit24968d20a07d483cd36b4747bd1db8bd512002c2 (patch)
treed306d08bc32edba292cf9aa85c3be8ba009c1b1c /app/services/unallow_domain_service.rb
parentf48c7689d230b915ed740a4774736bd5998cbc66 (diff)
parentb31b232edfcc7f04acf828bf6829ab716b290692 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/controllers/directories_controller.rb
- package.json
- yarn.lock
Diffstat (limited to 'app/services/unallow_domain_service.rb')
-rw-r--r--app/services/unallow_domain_service.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/services/unallow_domain_service.rb b/app/services/unallow_domain_service.rb
new file mode 100644
index 000000000..d4387c1a1
--- /dev/null
+++ b/app/services/unallow_domain_service.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class UnallowDomainService < BaseService
+  def call(domain_allow)
+    Account.where(domain: domain_allow.domain).find_each do |account|
+      SuspendAccountService.new.call(account, destroy: true)
+    end
+
+    domain_allow.destroy
+  end
+end