fix: handle active storage preview error for password protected pdfs (#11888)

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Vishnu Narayanan
2025-08-11 12:41:37 +05:30
committed by GitHub
parent f3bc2476fc
commit 6cab741392
4 changed files with 28 additions and 6 deletions

View File

@@ -60,11 +60,9 @@ class Attachment < ApplicationRecord
end
def thumb_url
if file.attached? && file.representable?
url_for(file.representation(resize_to_fill: [250, nil]))
else
''
end
return '' unless file.attached? && image?
url_for(file.representation(resize_to_fill: [250, nil]))
end
def with_attached_file?