Rename ASSOCIATIONS_ON_SUSPEND to ASSOCIATIONS_ON_PURGE (#39831)

This commit is contained in:
Claire 2026-07-15 16:41:20 +02:00 committed by Tarrien
parent f355f8c768
commit 21e4d729f1
2 changed files with 9 additions and 3 deletions

View File

@ -3,7 +3,7 @@
class DeleteAccountService < BaseService class DeleteAccountService < BaseService
include Payloadable include Payloadable
ASSOCIATIONS_ON_SUSPEND = %w( ASSOCIATIONS_ON_PURGE = %w(
account_notes account_notes
account_pins account_pins
active_relationships active_relationships
@ -304,9 +304,9 @@ class DeleteAccountService < BaseService
def associations_for_destruction def associations_for_destruction
if keep_account_record? if keep_account_record?
ASSOCIATIONS_ON_SUSPEND ASSOCIATIONS_ON_PURGE
else else
ASSOCIATIONS_ON_SUSPEND + ASSOCIATIONS_ON_DESTROY ASSOCIATIONS_ON_PURGE + ASSOCIATIONS_ON_DESTROY
end end
end end

View File

@ -63,6 +63,12 @@ RSpec.describe DeleteAccountService do
end end
end end
describe 'ASSOCIATIONS_WITHOUT_SIDE_EFFECTS' do
it 'is a subset of ASSOCIATIONS_ON_PURGE' do
expect(described_class::ASSOCIATIONS_WITHOUT_SIDE_EFFECTS - described_class::ASSOCIATIONS_ON_PURGE).to eq []
end
end
describe '#call on local account', :inline_jobs do describe '#call on local account', :inline_jobs do
before do before do
stub_request(:post, remote_alice.inbox_url).to_return(status: 201) stub_request(:post, remote_alice.inbox_url).to_return(status: 201)