Open mpetnuch opened 14 years ago
If you're running this under ruby 1.9.2 you have to make an additional change to the s3_backend.rb because of the way ruby 1.9.2 handles arrays to string.
Your public_filename method needs to change to look like the following:
def public_filename(*args)
if args.empty?
clean_args = nil
else
clean_args = args.join
end
if attachment_options[:cloudfront]
cloudfront_url(clean_args)
else
s3_url(clean_args)
end
end
If you have a separate thumbnail class the wrong public_filename is show when using S3/Cloud.
Examples:
File System:
S3/Cloud:
From 130b83b534fbdb03f15a5cc06c46c65d8e1629a2 Mon Sep 17 00:00:00 2001 From: Michael Petnuch michael@petnuch.com Date: Fri, 30 Jul 2010 11:59:50 -0400 Subject: [PATCH] Correct path when using thumbnail class with S3/Cloud
.../attachment_fu/backends/cloud_file_backend.rb | 7 ++++--- .../attachment_fu/backends/s3_backend.rb | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb b/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb index 214ab27..8d043de 100644 --- a/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb +++ b/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb @@ -142,14 +142,15 @@ module Technoweenie # :nodoc:
diff --git a/lib/technoweenie/attachment_fu/backends/s3_backend.rb b/lib/technoweenie/attachment_fu/backends/s3_backend.rb index 53b0caf..1593fc6 100644 --- a/lib/technoweenie/attachment_fu/backends/s3_backend.rb +++ b/lib/technoweenie/attachment_fu/backends/s3_backend.rb @@ -252,14 +252,15 @@ module Technoweenie # :nodoc:
1.7.2