Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clear the fingerprint when an attachment is removed

  • Loading branch information...
commit 189ee9c3b26de3dcbd2bd1931844e7173151ece1 1 parent 22a2a85
@tomhughes tomhughes authored
Showing with 7 additions and 0 deletions.
  1. +1 −0  lib/paperclip/attachment.rb
  2. +6 −0 test/attachment_test.rb
View
1  lib/paperclip/attachment.rb
@@ -462,6 +462,7 @@ def queue_existing_for_delete #:nodoc:
instance_write(:file_name, nil)
instance_write(:content_type, nil)
instance_write(:file_size, nil)
+ instance_write(:fingerprint, nil)
instance_write(:updated_at, nil)
end
View
6 test/attachment_test.rb
@@ -925,6 +925,7 @@ def do_after_all; end
@attachment.expects(:instance_write).with(:file_name, nil)
@attachment.expects(:instance_write).with(:content_type, nil)
@attachment.expects(:instance_write).with(:file_size, nil)
+ @attachment.expects(:instance_write).with(:fingerprint, nil)
@attachment.expects(:instance_write).with(:updated_at, nil)
@attachment.assign nil
@attachment.save
@@ -935,6 +936,7 @@ def do_after_all; end
@attachment.expects(:instance_write).with(:file_name, nil)
@attachment.expects(:instance_write).with(:content_type, nil)
@attachment.expects(:instance_write).with(:file_size, nil)
+ @attachment.expects(:instance_write).with(:fingerprint, nil)
@attachment.expects(:instance_write).with(:updated_at, nil)
@attachment.clear
@attachment.save
@@ -945,6 +947,7 @@ def do_after_all; end
@attachment.expects(:instance_write).with(:file_name, nil)
@attachment.expects(:instance_write).with(:content_type, nil)
@attachment.expects(:instance_write).with(:file_size, nil)
+ @attachment.expects(:instance_write).with(:fingerprint, nil)
@attachment.expects(:instance_write).with(:updated_at, nil)
@attachment.destroy
@existing_names.each{|f| assert ! File.exists?(f) }
@@ -959,6 +962,7 @@ def do_after_all; end
@attachment.expects(:instance_write).with(:file_name, nil)
@attachment.expects(:instance_write).with(:content_type, nil)
@attachment.expects(:instance_write).with(:file_size, nil)
+ @attachment.expects(:instance_write).with(:fingerprint, nil)
@attachment.expects(:instance_write).with(:updated_at, nil)
@attachment.assign nil
@attachment.save
@@ -969,6 +973,7 @@ def do_after_all; end
@attachment.expects(:instance_write).with(:file_name, nil)
@attachment.expects(:instance_write).with(:content_type, nil)
@attachment.expects(:instance_write).with(:file_size, nil)
+ @attachment.expects(:instance_write).with(:fingerprint, nil)
@attachment.expects(:instance_write).with(:updated_at, nil)
@attachment.clear
@attachment.save
@@ -979,6 +984,7 @@ def do_after_all; end
@attachment.expects(:instance_write).with(:file_name, nil)
@attachment.expects(:instance_write).with(:content_type, nil)
@attachment.expects(:instance_write).with(:file_size, nil)
+ @attachment.expects(:instance_write).with(:fingerprint, nil)
@attachment.expects(:instance_write).with(:updated_at, nil)
@attachment.destroy
@existing_names.each{|f| assert File.exists?(f) }
Please sign in to comment.
Something went wrong with that request. Please try again.