add service url time

This commit is contained in:
Pete Matsyburka
2026-06-19 16:33:55 +03:00
parent 7ec83b8af6
commit 1546258529
6 changed files with 24 additions and 11 deletions
+8
View File
@@ -5,6 +5,14 @@ ActiveSupport.on_load(:active_storage_attachment) do
has_many_attached :preview_images
def self.service_url_time
return unless Docuseal.multitenant?
now = Time.current
now.min < 30 ? now.beginning_of_hour : now.beginning_of_hour + 30.minutes
end
def signed_uuid
@signed_uuid ||= ApplicationRecord.signed_id_verifier.generate(uuid, expires_in: 6.hours, purpose: :attachment)
end