cache page url
This commit is contained in:
@@ -52,6 +52,7 @@ Rails.application.configure do
|
||||
end
|
||||
|
||||
config.active_storage.resolve_model_to_route = :rails_storage_proxy if ENV['ACTIVE_STORAGE_PUBLIC'] != 'true'
|
||||
config.active_storage.service_urls_expire_in = 15.minutes
|
||||
|
||||
# Mount Action Cable outside main process or domain.
|
||||
# config.action_cable.mount_path = nil
|
||||
|
||||
@@ -10,7 +10,11 @@ ActiveSupport.on_load(:active_storage_attachment) do
|
||||
end
|
||||
|
||||
def preview_image_url
|
||||
preview_images.joins(:blob).find_by(blob: { filename: '0.jpg' })&.url
|
||||
first_page = preview_images.joins(:blob).find_by(blob: { filename: '0.jpg' })
|
||||
|
||||
return unless first_page
|
||||
|
||||
Rails.application.routes.url_helpers.rails_storage_proxy_url(first_page, **Docuseal.default_url_options)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user