From f9a5839083e697f0d5aad6d9304cd5f26e2a7a11 Mon Sep 17 00:00:00 2001 From: Nicholas Shirley Date: Mon, 12 Feb 2018 12:29:18 +0100 Subject: Allow selectively purging attached blobs --- activestorage/lib/active_storage/attached/many.rb | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'activestorage/lib/active_storage/attached/many.rb') diff --git a/activestorage/lib/active_storage/attached/many.rb b/activestorage/lib/active_storage/attached/many.rb index 6eace65b79..d61acb6fad 100644 --- a/activestorage/lib/active_storage/attached/many.rb +++ b/activestorage/lib/active_storage/attached/many.rb @@ -44,20 +44,16 @@ module ActiveStorage attachments.destroy_all if attached? end + ## + # :method: purge + # # Directly purges each associated attachment (i.e. destroys the blobs and # attachments and deletes the files on the service). - def purge - if attached? - attachments.each(&:purge) - attachments.reload - end - end + + ## + # :method: purge_later + # # Purges each associated attachment through the queuing system. - def purge_later - if attached? - attachments.each(&:purge_later) - end - end end end -- cgit v1.2.3