mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-05 03:14:43 +08:00
Add handling for deleted ActiveStorage files [SCI-8264] (#5624)
Add handling for deleted ActiveStorage files [SCI-8264]
This commit is contained in:
parent
910ad2db5d
commit
6dc4b646c5
1 changed files with 5 additions and 0 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Reference in a new issue