Skip to content
Browse files

url is the location for s3

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@248 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information...
1 parent a6e2418 commit d76ef9be5812f596f806e3303f91121a78d769a8 jyurek committed Nov 18, 2007
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/paperclip/storage/s3.rb
View
8 lib/paperclip/storage/s3.rb
@@ -30,9 +30,15 @@ def self.credentials_file
end
end
+ def url_with_s3 style = nil
+ http_host = definition.s3_host || "http://s3.amazonaws.com"
+ "#{http_host}/#{bucket}/#{url_without_s3(style)}"
+ end
+ alias_method_chain :url, :s3
+
def file_name style = nil
style ||= definition.default_style
- interpolate( style, definition.path )
+ interpolate( style, definition.url )
end
def attachment_exists? style = nil

0 comments on commit d76ef9b

Please sign in to comment.
Something went wrong with that request. Please try again.