Skip to content
Browse files

Cosmetic changes to fingerprinting.

  • Loading branch information...
1 parent 2cdeb39 commit 15c6c9e83bcd4b76726f52ab4e4bc19148b03bef @jyurek jyurek committed Aug 16, 2010
Showing with 7 additions and 8 deletions.
  1. +7 −8 lib/paperclip/attachment.rb
View
15 lib/paperclip/attachment.rb
@@ -15,7 +15,7 @@ def self.default_options
:default_url => "/:attachment/:style/missing.png",
:default_style => :original,
:storage => :filesystem,
- :include_updated_timestamp => true,
+ :use_timestamp => true,
:whiny => Paperclip.options[:whiny] || Paperclip.options[:whiny_thumbnails]
}
end
@@ -40,7 +40,7 @@ def initialize name, instance, options = {}
@default_url = options[:default_url]
@default_style = options[:default_style]
@storage = options[:storage]
- @include_updated_timestamp = options[:include_updated_timestamp]
+ @use_timestamp = options[:use_timestamp]
@whiny = options[:whiny_thumbnails] || options[:whiny]
@convert_options = options[:convert_options]
@processors = options[:processors]
@@ -100,7 +100,7 @@ def assign uploaded_file
post_process
# Reset the file size if the original file was reprocessed.
- instance_write(:file_size, @queued_for_write[:original].size.to_i)
+ instance_write(:file_size, @queued_for_write[:original].size.to_i)
instance_write(:fingerprint, @queued_for_write[:original].fingerprint)
ensure
uploaded_file.close if close_uploaded_file
@@ -110,12 +110,11 @@ def assign uploaded_file
# this does not necessarily need to point to a file that your web server
# can access and can point to an action in your app, if you need fine
# grained security. This is not recommended if you don't need the
- # security, however, for performance reasons. set
- # include_updated_timestamp to false if you want to stop the attachment
- # update time appended to the url
- def url(style_name = default_style, include_updated_timestamp = @include_updated_timestamp)
+ # security, however, for performance reasons. Set use_timestamp to false
+ # if you want to stop the attachment update time appended to the url
+ def url(style_name = default_style, use_timestamp = @use_timestamp)
url = original_filename.nil? ? interpolate(@default_url, style_name) : interpolate(@url, style_name)
- include_updated_timestamp && updated_at ? [url, updated_at].compact.join(url.include?("?") ? "&" : "?") : url
+ use_timestamp && updated_at ? [url, updated_at].compact.join(url.include?("?") ? "&" : "?") : url
end
# Returns the path of the attachment as defined by the :path option. If the

0 comments on commit 15c6c9e

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