Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Fix the formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-burns committed Aug 26, 2011
1 parent 472a625 commit d00c04e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/paperclip.rb
Expand Up @@ -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
8 changes: 4 additions & 4 deletions test/attachment_test.rb
Expand Up @@ -1076,16 +1076,16 @@ def self.interpolate(pattern, attachment, style_name)
assert_equal "hello", attachment.url
end
end

context "An attached file" do
setup do
rebuild_model
@dummy = Dummy.new
@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
Expand All @@ -1103,5 +1103,5 @@ def self.interpolate(pattern, attachment, style_name)
assert ! File.exists?(@path)
end
end

end

0 comments on commit d00c04e

Please sign in to comment.