heythisisnate-paperclip 2.3.0.1 → 2.3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/paperclip/attachment.rb +7 -3
- metadata +1 -1
data/lib/paperclip/attachment.rb
CHANGED
@@ -100,9 +100,13 @@ module Paperclip
|
|
100
100
|
# security, however, for performance reasons. set
|
101
101
|
# include_updated_timestamp to false if you want to stop the attachment
|
102
102
|
# update time appended to the url
|
103
|
-
def url style = default_style, include_updated_timestamp = true
|
104
|
-
|
105
|
-
|
103
|
+
#def url style = default_style, include_updated_timestamp = true
|
104
|
+
# url = original_filename.nil? ? interpolate(@default_url, style) : interpolate(@url, style)
|
105
|
+
# include_updated_timestamp && updated_at ? [url, updated_at].compact.join(url.include?("?") ? "&" : "?") : url
|
106
|
+
#end
|
107
|
+
|
108
|
+
def url(style = nil, time_limit = 5.seconds)
|
109
|
+
AWS::S3::S3Object.url_for(path(style).gsub(%r{^/}, ""), 'dpic', :expires_in => time_limit)
|
106
110
|
end
|
107
111
|
|
108
112
|
# Returns the path of the attachment as defined by the :path option. If the
|