From e4332ba35fea68b81be2957af2464cab4f54b9fd Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 25 May 2012 20:54:11 +0000 Subject: [PATCH] Code cleanup. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9717 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 8daa4cf0b..b61db87e5 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -123,7 +123,7 @@ class Attachment < ActiveRecord::Base # Deletes the file from the file system if it's not referenced by other attachments def delete_from_disk - if Attachment.first(:conditions => ["disk_filename = ? AND id <> ?", disk_filename, id]).nil? + if Attachment.where("disk_filename = ? AND id <> ?", disk_filename, id).empty? delete_from_disk! end end