Permalink
Browse files

Add expiring_url as an alias for url

  • Loading branch information...
1 parent 6687522 commit 27c0eee43db466aa9a6bc5ef8abd95b05e67d25f @aarellano aarellano committed with jyurek Mar 8, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/paperclip/attachment.rb
@@ -146,6 +146,13 @@ def url(style_name = default_style, options = {})
end
end
+ # Alias to +url+ that allows using the expiring_url method provided by the cloud
+ # storage implementations, but keep using filesystem storage for development and
+ # testing.
+ def expiring_url(time = 3600, style_name = default_style)
+ url(style_name)
+ end
+
# Returns the path of the attachment as defined by the :path option. If the
# file is stored in the filesystem the path refers to the path of the file
# on disk. If the file is stored in S3, the path is the "key" part of the

0 comments on commit 27c0eee

Please sign in to comment.