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.
Files changed (2) hide show
  1. data/lib/paperclip/attachment.rb +7 -3
  2. metadata +1 -1
@@ -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
- 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
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heythisisnate-paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.1
4
+ version: 2.3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Yurek