|
|
|
@ -265,6 +265,10 @@ class AttachmentsController < ApplicationController
|
|
|
|
|
@history.save #历史记录保存完毕
|
|
|
|
|
#将最新保存的记录 数据替换到 需要修改的文件记录
|
|
|
|
|
@old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes")
|
|
|
|
|
# 如果附件描述被修改,则保存附件
|
|
|
|
|
unless params[:description] == @attachment.description
|
|
|
|
|
@old_attachment.description = params[:description]
|
|
|
|
|
end
|
|
|
|
|
@old_attachment.save
|
|
|
|
|
#删除当前记录
|
|
|
|
|
@attachment.delete
|
|
|
|
|