Skip to content
Browse files

performance: only define s3 interpolations once.

  • Loading branch information...
1 parent 317c04b commit 9ec35a6d4cee91a0c5730fafcf9b8d420f16f200 @jhawthorn jhawthorn committed with jyurek Feb 24, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/paperclip/storage/s3.rb
View
6 lib/paperclip/storage/s3.rb
@@ -85,13 +85,13 @@ def self.extended base
end
Paperclip.interpolates(:s3_alias_url) do |attachment, style|
"#{attachment.s3_protocol}://#{attachment.s3_host_alias}/#{attachment.path(style).gsub(%r{^/}, "")}"
- end
+ end unless Paperclip::Interpolations.respond_to? :s3_alias_url
Paperclip.interpolates(:s3_path_url) do |attachment, style|
"#{attachment.s3_protocol}://s3.amazonaws.com/#{attachment.bucket_name}/#{attachment.path(style).gsub(%r{^/}, "")}"
- end
+ end unless Paperclip::Interpolations.respond_to? :s3_path_url
Paperclip.interpolates(:s3_domain_url) do |attachment, style|
"#{attachment.s3_protocol}://#{attachment.bucket_name}.s3.amazonaws.com/#{attachment.path(style).gsub(%r{^/}, "")}"
- end
+ end unless Paperclip::Interpolations.respond_to? :s3_domain_url
end
def expiring_url(time = 3600)

0 comments on commit 9ec35a6

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