Skip to content

Commit

Permalink
Merge pull request #2660 from joshuamsager/joshuamsager/cleaner-fog_p…
Browse files Browse the repository at this point in the history
…rovider

Use helper method to access fog_provider
  • Loading branch information
mshibuya committed Mar 18, 2023
2 parents 54f4d27 + 312c9f7 commit 1dc6de5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/carrierwave/storage/fog.rb
Expand Up @@ -198,12 +198,12 @@ def attributes
# [NilClass] no authenticated url available
#
def authenticated_url(options = {})
if ['AWS', 'Google', 'Rackspace', 'OpenStack', 'AzureRM', 'Aliyun', 'backblaze'].include?(@uploader.fog_credentials[:provider])
if ['AWS', 'Google', 'Rackspace', 'OpenStack', 'AzureRM', 'Aliyun', 'backblaze'].include?(fog_provider)
# avoid a get by using local references
local_directory = connection.directories.new(:key => @uploader.fog_directory)
local_file = local_directory.files.new(:key => path)
expire_at = options[:expire_at] || ::Fog::Time.now.since(@uploader.fog_authenticated_url_expiration.to_i)
case @uploader.fog_credentials[:provider]
case fog_provider
when 'AWS', 'Google'
# Older versions of fog-google do not support options as a parameter
if url_options_supported?(local_file)
Expand Down

0 comments on commit 1dc6de5

Please sign in to comment.