From 4ecd5b1d0568029209d8574819f1535b4729bf74 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Fri, 7 Oct 2011 19:32:35 -0400 Subject: [PATCH] Remove :rails_root/public/system from default URL of S3 storage So instead of having: http://s3.amazonaws.com/paperclip/var/www/foo.com/current/avatars/1/original/foo.jpg because default path has the :rails_root, now you'd have: http://s3.amazonaws.com/paperclip/avatars/1/original/foo.jpg This shouldn't affect your application because you'd normally set the path to some string. --- lib/paperclip/storage/s3.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paperclip/storage/s3.rb b/lib/paperclip/storage/s3.rb index 65372af0c..0a9102597 100644 --- a/lib/paperclip/storage/s3.rb +++ b/lib/paperclip/storage/s3.rb @@ -86,7 +86,7 @@ def self.extended base @s3_headers = @options.s3_headers || {} unless @options.url.to_s.match(/^:s3.*url$/) || @options.url == ":asset_host" - @options.path = @options.path.gsub(/:url/, @options.url) + @options.path = @options.path.gsub(/:url/, @options.url).gsub(/^:rails_root\/public\/system/, '') @options.url = ":s3_path_url" end @options.url = @options.url.inspect if @options.url.is_a?(Symbol)