Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug when trying to check if file exists on S3

  • Loading branch information...
commit 7cb3f6ab88d1295116801a939b5e34bac1561b8f 1 parent a4bb7f3
@willian willian authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/storage/strategies/s3.rb
View
10 lib/storage/strategies/s3.rb
@@ -16,7 +16,7 @@ def disconnect!
def get(file, options = {})
connect!
- object = find_object(file, options)
+ object = find_object(options)
AWS::S3::S3Object.url_for(file, options[:bucket], :authenticated => false)
rescue AWS::S3::NoSuchKey, AWS::S3::NoSuchBucket
raise Storage::MissingFileError
@@ -24,7 +24,7 @@ def get(file, options = {})
def store(file, options = {})
connect!
- object = find_object(file, options) rescue nil
+ object = find_object(options) rescue nil
raise Storage::FileAlreadyExistsError if object
@@ -35,7 +35,7 @@ def store(file, options = {})
def remove(file, options = {})
connect!
- object = find_object(file, options)
+ object = find_object(options)
object.delete
rescue AWS::S3::NoSuchKey, AWS::S3::NoSuchBucket
raise Storage::MissingFileError
@@ -45,8 +45,8 @@ def find_bucket(name)
AWS::S3::Bucket.find(name)
end
- def find_object(file, options = {})
- AWS::S3::S3Object.find(file, options[:bucket])
+ def find_object(options = {})
+ AWS::S3::S3Object.find(options[:name], options[:bucket])
end
def find_bucket_or_create(name)
Please sign in to comment.
Something went wrong with that request. Please try again.