|
|
|
@ -251,7 +251,7 @@ class AttachmentsController < ApplicationController
|
|
|
|
|
@history.version = @old_history.nil? ? 1 : @old_history.version + 1
|
|
|
|
|
@history.save #历史记录保存完毕
|
|
|
|
|
#将最新保存的记录 数据替换到 需要修改的文件记录
|
|
|
|
|
@old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads")
|
|
|
|
|
@old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes")
|
|
|
|
|
@old_attachment.save
|
|
|
|
|
#删除当前记录
|
|
|
|
|
@attachment.delete
|
|
|
|
|