1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove few ivars from gcs_service implementation

This commit is contained in:
dixpac 2017-07-13 20:39:02 +02:00
parent c55af14d1b
commit 2a738b31c5

View file

@ -36,20 +36,14 @@ class ActiveStorage::Service::GCSService < ActiveStorage::Service
def exist?(key)
instrument :exist, key do |payload|
answer = file_for(key).present?
payload[:exist] = answer
answer
payload[:exist] = file_for(key).present?
end
end
def url(key, expires_in:, disposition:, filename:)
instrument :url, key do |payload|
query = { "response-content-disposition" => "#{disposition}; filename=\"#{filename}\"" }
generated_url = file_for(key).signed_url(expires: expires_in, query: query)
payload[:url] = generated_url
generated_url
payload[:url] = file_for(key).signed_url(expires: expires_in, query: query)
end
end