From 5515fb660f4690f763a2fa678dde5d612c896d6e Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 14 Jun 2016 14:47:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=B5=84=E6=BA=90=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=97=B6=E5=80=99=20=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E7=BB=A7=E6=89=BF=E9=97=AE=E9=A2=98=EF=BC=8C=E5=B9=B6=E4=B8=94?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 4 ++++ app/views/attachments/_show_attachment_history.html.erb | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index fe3c3272a..960bc61e6 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -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 diff --git a/app/views/attachments/_show_attachment_history.html.erb b/app/views/attachments/_show_attachment_history.html.erb index fb2afd308..edb3ef17e 100644 --- a/app/views/attachments/_show_attachment_history.html.erb +++ b/app/views/attachments/_show_attachment_history.html.erb @@ -39,6 +39,14 @@ +
+ +
+ +
+
+
+
(未选择文件)
您可以上传小于50MB的文件