diff --git a/lib/paperclip.rb b/lib/paperclip.rb index 2645188e2..8130709ed 100644 --- a/lib/paperclip.rb +++ b/lib/paperclip.rb @@ -411,14 +411,14 @@ def destroy_attached_files attachment.send(:flush_deletes) end end - + def prepare_for_destroy Paperclip.log("Scheduling attachments for deletion.") each_attachment do |name, attachment| attachment.send(:queue_existing_for_delete) end end - + end end diff --git a/test/attachment_test.rb b/test/attachment_test.rb index 53c0840df..d280f839c 100644 --- a/test/attachment_test.rb +++ b/test/attachment_test.rb @@ -1076,7 +1076,7 @@ def self.interpolate(pattern, attachment, style_name) assert_equal "hello", attachment.url end end - + context "An attached file" do setup do rebuild_model @@ -1084,8 +1084,8 @@ def self.interpolate(pattern, attachment, style_name) @file = File.new(File.join(File.dirname(__FILE__), "fixtures", "5k.png"), 'rb') @dummy.avatar = @file @dummy.save! - @attachment = @dummy.avatar - @path = @attachment.path + @attachment = @dummy.avatar + @path = @attachment.path end should "not be deleted when the model fails to destroy" do @@ -1103,5 +1103,5 @@ def self.interpolate(pattern, attachment, style_name) assert ! File.exists?(@path) end end - + end