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:
parent
c55af14d1b
commit
2a738b31c5
1 changed files with 2 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue