diff options
author | ThibG <thib@sitedethib.com> | 2019-08-08 09:25:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-08 09:25:00 +0200 |
commit | aa485d6f055b93fd7a9df8b47ed96122b38af39e (patch) | |
tree | c0a0bab3b7006e00b2a0881460d14fb7bd24c4aa /app/services/unblock_domain_service.rb | |
parent | 86cfa2ea6cb94c9597b9fcda034c8b4d959c5e3e (diff) | |
parent | 9b8edbea5b3f0e7690c645502a0f1dcd22fb8737 (diff) |
Merge pull request #1194 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/unblock_domain_service.rb')
-rw-r--r-- | app/services/unblock_domain_service.rb | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/app/services/unblock_domain_service.rb b/app/services/unblock_domain_service.rb index fc262a50a..d502d9e49 100644 --- a/app/services/unblock_domain_service.rb +++ b/app/services/unblock_domain_service.rb @@ -10,24 +10,9 @@ class UnblockDomainService < BaseService end def process_retroactive_updates - blocked_accounts.in_batches.update_all(update_options) unless domain_block.noop? - end - - def blocked_accounts scope = Account.by_domain_and_subdomains(domain_block.domain) - if domain_block.silence? - scope.where(silenced_at: @domain_block.created_at) - else - scope.where(suspended_at: @domain_block.created_at) - end - end - - def update_options - { domain_block_impact => nil } - end - - def domain_block_impact - domain_block.silence? ? :silenced_at : :suspended_at + scope.where(silenced_at: domain_block.created_at).in_batches.update_all(silenced_at: nil) unless domain_block.noop? + scope.where(suspended_at: domain_block.created_at).in_batches.update_all(suspended_at: nil) if domain_block.suspend? end end |