From 62faf7354e316955c1ebafc292b08af2ea013769 Mon Sep 17 00:00:00 2001 From: Geoff Johnson Date: Tue, 2 Aug 2022 14:45:46 -0700 Subject: [PATCH] feat: add ability to attach options to url generation --- lib/paperclip/storage/s3.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/paperclip/storage/s3.rb b/lib/paperclip/storage/s3.rb index 8ae09c3a8..2bfa8f86e 100644 --- a/lib/paperclip/storage/s3.rb +++ b/lib/paperclip/storage/s3.rb @@ -186,9 +186,9 @@ def self.extended base end unless Paperclip::Interpolations.respond_to? :asset_host end - def expiring_url(time = 3600, style_name = default_style) + def expiring_url(time = 3600, style_name = default_style, extra_options = {}) if path(style_name) - base_options = { expires_in: time } + base_options = { expires_in: time }.merge(extra_options) s3_object(style_name).presigned_url( :get, base_options.merge(s3_url_options),