Permalink
Browse files

don't copy the #full_filename to the default #temp_paths array if it …

…doesn't exist

git-svn-id: http://svn.techno-weenie.net/projects/plugins/attachment_fu@2834 567b1171-46fb-0310-a4c9-b4bef9110e78
  • Loading branch information...
technoweenie
technoweenie committed Apr 3, 2007
1 parent 66548c0 commit 6394c42c5627be05dafa61a5da8b3965e8528d97
Showing with 2 additions and 1 deletion.
  1. +1 −0 CHANGELOG
  2. +1 −1 lib/technoweenie/attachment_fu.rb
View
@@ -1,5 +1,6 @@
* April 2, 2007 *
+* don't copy the #full_filename to the default #temp_paths array if it doesn't exist
* add default ID partitioning for attachments
* add #binmode call to Tempfile (note: ruby should be doing this!) [Eric Beland]
* Check for current type of :thumbnails option.
@@ -273,7 +273,7 @@ def temp_path
# Gets an array of the currently used temp paths. Defaults to a copy of #full_filename.
def temp_paths
- @temp_paths ||= new_record? ? [] : [copy_to_temp_file(full_filename)]
+ @temp_paths ||= (new_record? || !File.exist?(full_filename)) ? [] : [copy_to_temp_file(full_filename)]
end
# Adds a new temp_path to the array. This should take a string or a Tempfile. This class makes no

0 comments on commit 6394c42

Please sign in to comment.