Permalink
Browse files

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.
  • Loading branch information...
1 parent 56e4135 commit 4ecd5b1d0568029209d8574819f1535b4729bf74 @sikachu sikachu committed Oct 7, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 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)

0 comments on commit 4ecd5b1

Please sign in to comment.