@ -355,8 +355,9 @@ class Attachment < ActiveRecord::Base
end
end
end
end
#有了历史记录的数据记录是不能被删除的。
defdestroyable
defdestroyable
Attachment.where("disk_filename = ? AND id <> ?",disk_filename,id).empty?&&self.attachment_histories.count==0&&Attachment.where('copy_from = ?',self.id).count==0
Attachment.where("disk_filename = ? AND id <> ?",disk_filename,id).empty?&&self.attachment_histories.count==0