diff options
author | Effy Elden <github@effy.is> | 2017-04-17 01:41:33 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-17 01:41:33 +1000 |
commit | acd33101c50ba0cf09c1c41616f919d37760f3f7 (patch) | |
tree | 43564c181a7f58ce7471026bd0daa099344330e8 /app/services/unblock_domain_service.rb | |
parent | fd81916e8625e5de39855522300eaeffd85ee13d (diff) | |
parent | 99226aba9391535a20d3cc6dba0f45e5792c73d4 (diff) |
Merge branch 'master' into fix/cache_blocking
Diffstat (limited to 'app/services/unblock_domain_service.rb')
-rw-r--r-- | app/services/unblock_domain_service.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/services/unblock_domain_service.rb b/app/services/unblock_domain_service.rb new file mode 100644 index 000000000..9794e439d --- /dev/null +++ b/app/services/unblock_domain_service.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class UnblockDomainService < BaseService + def call(domain_block, retroactive) + if retroactive + if domain_block.silence? + Account.where(domain: domain_block.domain).update_all(silenced: false) + else + Account.where(domain: domain_block.domain).update_all(suspended: false) + end + end + + domain_block.destroy + end +end |