Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Remove :rails_root/public/system from default URL of S3 storage
Browse files Browse the repository at this point in the history
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
sikachu committed Oct 10, 2011
1 parent 56e4135 commit 4ecd5b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperclip/storage/s3.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 4ecd5b1

Please sign in to comment.