diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-05-15 17:11:40 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-05-15 17:11:40 +0200 |
commit | 6badf2d252a980d496b894c7258a778c57639953 (patch) | |
tree | b7c71885c413a8205dbe9d01bab7c60ea75c11bf /app/services/unblock_domain_service.rb | |
parent | cd534830adab89300703904ffe87894dec8e2f95 (diff) | |
parent | f4f22391b2d469bd1d5c29ec815daf020282f30c (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/services/unblock_domain_service.rb')
-rw-r--r-- | app/services/unblock_domain_service.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/services/unblock_domain_service.rb b/app/services/unblock_domain_service.rb index 946b6d465..9b8526fbe 100644 --- a/app/services/unblock_domain_service.rb +++ b/app/services/unblock_domain_service.rb @@ -3,9 +3,9 @@ class UnblockDomainService < BaseService attr_accessor :domain_block - def call(domain_block, retroactive) + def call(domain_block) @domain_block = domain_block - process_retroactive_updates if retroactive + process_retroactive_updates domain_block.destroy end @@ -14,14 +14,19 @@ class UnblockDomainService < BaseService end def blocked_accounts - Account.where(domain: domain_block.domain) + scope = Account.where(domain: 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 => false } + { domain_block_impact => nil } end def domain_block_impact - domain_block.silence? ? :silenced : :suspended + domain_block.silence? ? :silenced_at : :suspended_at end end |