Commit 4ecd5b1d by Prem Sichanugrist

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.
parent 56e41359
...@@ -86,7 +86,7 @@ module Paperclip ...@@ -86,7 +86,7 @@ module Paperclip
@s3_headers = @options.s3_headers || {} @s3_headers = @options.s3_headers || {}
unless @options.url.to_s.match(/^:s3.*url$/) || @options.url == ":asset_host" 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" @options.url = ":s3_path_url"
end end
@options.url = @options.url.inspect if @options.url.is_a?(Symbol) @options.url = @options.url.inspect if @options.url.is_a?(Symbol)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment