aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/attached/many.rb
diff options
context:
space:
mode:
authorNicholas Shirley <nicholas@reallymy.email>2018-02-12 12:29:18 +0100
committerGeorge Claghorn <george@basecamp.com>2018-03-06 13:03:02 -0500
commitf9a5839083e697f0d5aad6d9304cd5f26e2a7a11 (patch)
tree5d69dc69db87cda7040b61d11aeb4e1787cb32c7 /activestorage/lib/active_storage/attached/many.rb
parent40d3fa5dfe01d0e3bd0f6530aba3b4cddfda3969 (diff)
downloadrails-f9a5839083e697f0d5aad6d9304cd5f26e2a7a11.tar.gz
rails-f9a5839083e697f0d5aad6d9304cd5f26e2a7a11.tar.bz2
rails-f9a5839083e697f0d5aad6d9304cd5f26e2a7a11.zip
Allow selectively purging attached blobs
Diffstat (limited to 'activestorage/lib/active_storage/attached/many.rb')
-rw-r--r--activestorage/lib/active_storage/attached/many.rb18
1 files changed, 7 insertions, 11 deletions
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