@@ -123,7 +123,7 class Attachment < ActiveRecord::Base | |||
|
123 | 123 | |
|
124 | 124 | # Deletes the file from the file system if it's not referenced by other attachments |
|
125 | 125 | def delete_from_disk |
|
126 |
if Attachment. |
|
|
126 | if Attachment.where("disk_filename = ? AND id <> ?", disk_filename, id).empty? | |
|
127 | 127 | delete_from_disk! |
|
128 | 128 | end |
|
129 | 129 | end |
General Comments 0
You need to be logged in to leave comments.
Login now