Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9717 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d664fdcde9
commit
e4332ba35f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue