summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-05-25 20:54:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-05-25 20:54:11 +0000
commite4332ba35fea68b81be2957af2464cab4f54b9fd (patch)
tree54c05b3d0024634cd8b60680ae22595e5ae64bc7
parentd664fdcde9437007c291f7e1ad18257da20d57df (diff)
downloadredmine-e4332ba35fea68b81be2957af2464cab4f54b9fd.tar.gz
redmine-e4332ba35fea68b81be2957af2464cab4f54b9fd.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9717 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/attachment.rb2
1 files changed, 1 insertions, 1 deletions
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