fix redefinition of signed_id Rails method by supporting options as arg

This commit is contained in:
Nicolas Cavigneaux 2023-03-06 17:16:52 +01:00 committed by Colin Darie
parent 00e640a21d
commit 388ccca263
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -5,8 +5,8 @@ module BlobSignedIdConcern
# We override signed_id to add `expires_in` option to generated hash.
# This is a measure to ensure that we never under any circumstance
# expose permanent attachment url
def signed_id
ActiveStorage.verifier.generate(id, purpose: :blob_id, expires_in: Rails.application.config.active_storage.service_urls_expire_in)
def signed_id(**options)
ActiveStorage.verifier.generate(id, **options, purpose: :blob_id, expires_in: Rails.application.config.active_storage.service_urls_expire_in)
end
end
end