Commit 15c6c9e8 by Jon Yurek

Cosmetic changes to fingerprinting.

parent 2cdeb39a
...@@ -15,7 +15,7 @@ module Paperclip ...@@ -15,7 +15,7 @@ module Paperclip
:default_url => "/:attachment/:style/missing.png", :default_url => "/:attachment/:style/missing.png",
:default_style => :original, :default_style => :original,
:storage => :filesystem, :storage => :filesystem,
:include_updated_timestamp => true, :use_timestamp => true,
:whiny => Paperclip.options[:whiny] || Paperclip.options[:whiny_thumbnails] :whiny => Paperclip.options[:whiny] || Paperclip.options[:whiny_thumbnails]
} }
end end
...@@ -40,7 +40,7 @@ module Paperclip ...@@ -40,7 +40,7 @@ module Paperclip
@default_url = options[:default_url] @default_url = options[:default_url]
@default_style = options[:default_style] @default_style = options[:default_style]
@storage = options[:storage] @storage = options[:storage]
@include_updated_timestamp = options[:include_updated_timestamp] @use_timestamp = options[:use_timestamp]
@whiny = options[:whiny_thumbnails] || options[:whiny] @whiny = options[:whiny_thumbnails] || options[:whiny]
@convert_options = options[:convert_options] @convert_options = options[:convert_options]
@processors = options[:processors] @processors = options[:processors]
...@@ -100,7 +100,7 @@ module Paperclip ...@@ -100,7 +100,7 @@ module Paperclip
post_process post_process
# Reset the file size if the original file was reprocessed. # 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) instance_write(:fingerprint, @queued_for_write[:original].fingerprint)
ensure ensure
uploaded_file.close if close_uploaded_file uploaded_file.close if close_uploaded_file
...@@ -110,12 +110,11 @@ module Paperclip ...@@ -110,12 +110,11 @@ module Paperclip
# this does not necessarily need to point to a file that your web server # 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 # 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 # grained security. This is not recommended if you don't need the
# security, however, for performance reasons. set # security, however, for performance reasons. Set use_timestamp to false
# include_updated_timestamp to false if you want to stop the attachment # if you want to stop the attachment update time appended to the url
# update time appended to the url def url(style_name = default_style, use_timestamp = @use_timestamp)
def url(style_name = default_style, include_updated_timestamp = @include_updated_timestamp)
url = original_filename.nil? ? interpolate(@default_url, style_name) : interpolate(@url, style_name) 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 end
# Returns the path of the attachment as defined by the :path option. If the # Returns the path of the attachment as defined by the :path option. If the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment