Method: ActiveStorage::Attachment#purge

Defined in:
activestorage/app/models/active_storage/attachment.rb

#purgeObject

Synchronously deletes the attachment and purges the blob.



51
52
53
54
55
56
57
# File 'activestorage/app/models/active_storage/attachment.rb', line 51

def purge
  transaction do
    delete
    record.touch if record&.persisted?
  end
  blob&.purge
end