use signed uuid in previews

This commit is contained in:
Pete Matsyburka committed 2024-02-17 22:32:52 +02:00
1 parent 229d78c78b
commit 323f5c0c15
10 files changed
+24 -12

No files matched your search

+4
View File
@@ -5,6 +5,10 @@ ActiveSupport.on_load(:active_storage_attachment) do
has_many_attached :preview_images
def signed_uuid
@signed_uuid ||= ApplicationRecord.signed_id_verifier.generate(uuid, expires_in: 6.hours)
end
def preview_image_url
preview_images.joins(:blob).find_by(blob: { filename: '0.jpg' })&.url
end