Add handling for deleted ActiveStorage files [SCI-8264] (#5624)

Add handling for deleted ActiveStorage files [SCI-8264]
This commit is contained in:
ajugo 2023-07-03 13:13:19 +02:00 committed by GitHub
parent 910ad2db5d
commit 6dc4b646c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,11 @@ module ActiveStorage
include ActiveStorage::SetBlob
include ActiveStorage::CheckBlobPermissions
rescue_from ActiveRecord::RecordNotFound do |e|
Rails.logger.error(e.message)
render json: {}, status: :not_found
end
def show
if @blob.attachments.take.record_type == 'Asset'
return render plain: '', status: :accepted unless preview_ready?