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