aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-19 20:26:56 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-19 20:26:56 -0400
commit3f53296f1823417d9793c4616e9134414b7be0e8 (patch)
treec9f7f5c4a93d50fc872dc1b5bdff683e8315aca4 /activestorage/app
parent07ecaa614b127a1a0b319c5f8eab3d6cad630ddc (diff)
downloadrails-3f53296f1823417d9793c4616e9134414b7be0e8.tar.gz
rails-3f53296f1823417d9793c4616e9134414b7be0e8.tar.bz2
rails-3f53296f1823417d9793c4616e9134414b7be0e8.zip
Delete attachment before purging blob
Diffstat (limited to 'activestorage/app')
-rw-r--r--activestorage/app/models/active_storage/attachment.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/app/models/active_storage/attachment.rb b/activestorage/app/models/active_storage/attachment.rb
index 5d36990fb9..1c4dc25094 100644
--- a/activestorage/app/models/active_storage/attachment.rb
+++ b/activestorage/app/models/active_storage/attachment.rb
@@ -19,14 +19,14 @@ class ActiveStorage::Attachment < ActiveRecord::Base
# Synchronously deletes the attachment and {purges the blob}[rdoc-ref:ActiveStorage::Blob#purge].
def purge
- blob.purge
delete
+ blob.purge
end
# Deletes the attachment and {enqueues a background job}[rdoc-ref:ActiveStorage::Blob#purge_later] to purge the blob.
def purge_later
- blob.purge_later
delete
+ blob.purge_later
end
private