lib/paperclip/storage/s3.rb in paperclip-4.2.4 vs lib/paperclip/storage/s3.rb in paperclip-4.3.0
- old
+ new
@@ -2,11 +2,11 @@
module Storage
# Amazon's S3 file hosting service is a scalable, easy place to store files for
# distribution. You can find out more about it at http://aws.amazon.com/s3
#
# To use Paperclip with S3, include the +aws-sdk+ gem in your Gemfile:
- # gem 'aws-sdk'
+ # gem 'aws-sdk', '~> 1.6'
# There are a few S3-specific options for has_attached_file:
# * +s3_credentials+: Takes a path, a File, a Hash or a Proc. The path (or File) must point
# to a YAML file containing the +access_key_id+ and +secret_access_key+ that Amazon
# gives you. You can 'environment-space' this just like you do to your
# database.yml file, so different environments can use different accounts:
@@ -286,11 +286,10 @@
end
def parse_credentials creds
creds = creds.respond_to?('call') ? creds.call(self) : creds
creds = find_credentials(creds).stringify_keys
- env = Object.const_defined?(:Rails) ? Rails.env : nil
- (creds[env] || creds).symbolize_keys
+ (creds[RailsEnvironment.get] || creds).symbolize_keys
end
def exists?(style = default_style)
if original_filename
s3_object(style).exists?