optimize templates api

This commit is contained in:
Pete Matsyburka committed 2024-02-24 19:59:50 +02:00
1 parent 02adbae758
commit b9a906b569
3 files changed
+57 -19

No files matched your search

-8
View File
@@ -8,14 +8,6 @@ ActiveSupport.on_load(:active_storage_attachment) do
def signed_uuid
@signed_uuid ||= ApplicationRecord.signed_id_verifier.generate(uuid, expires_in: 6.hours, purpose: :attachment)
end
def preview_image_url
first_page = preview_images.joins(:blob).find_by(blob: { filename: '0.jpg' })
return unless first_page
ActiveStorage::Blob.proxy_url(first_page.blob)
end
end
ActiveSupport.on_load(:active_storage_blob) do