You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From 130b83b534fbdb03f15a5cc06c46c65d8e1629a2 Mon Sep 17 00:00:00 2001
From: Michael Petnuch [email protected]
Date: Fri, 30 Jul 2010 11:59:50 -0400
Subject: [PATCH] Correct path when using thumbnail class with S3/Cloud
File.join(file_system_path, attachment_path_id)
end
# The full path to the file relative to the container name
# Example: <tt>:table_name/:id/:filename</tt>
def full_filename(thumbnail = nil)
File.join(base_path(thumbnail), thumbnail_name_for(thumbnail))
end
# All public objects are accessible via a GET request to the Cloud Files servers. You can generate a
File.join(file_system_path, attachment_path_id)
end
# The full path to the file relative to the bucket name
# Example: <tt>:table_name/:id/:filename</tt>
def full_filename(thumbnail = nil)
File.join(base_path(thumbnail), thumbnail_name_for(thumbnail))
end
# All public objects are accessible via a GET request to the S3 servers. You can generate a
1.7.2
The text was updated successfully, but these errors were encountered:
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:
Here is a patch that fixes it:
From 130b83b534fbdb03f15a5cc06c46c65d8e1629a2 Mon Sep 17 00:00:00 2001
From: Michael Petnuch [email protected]
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
The text was updated successfully, but these errors were encountered: