diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 0a4b432ce..b29f6e2a1 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -212,7 +212,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") + @old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public") @old_attachment.save #删除当前记录 @attachment.delete diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3aa86946f..ecd26870a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1493,6 +1493,7 @@ class UsersController < ApplicationController attach_copied_obj.container = Course.find(id) attach_copied_obj.created_on = Time.now attach_copied_obj.author_id = User.current.id + attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 4 end @@ -1517,6 +1518,7 @@ class UsersController < ApplicationController attach_copied_obj.container = Course.find(id) attach_copied_obj.created_on = Time.now attach_copied_obj.author_id = User.current.id + attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 4 end @@ -1563,6 +1565,7 @@ class UsersController < ApplicationController attach_copied_obj.container = Project.find(project_id) attach_copied_obj.created_on = Time.now attach_copied_obj.author_id = User.current.id + attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end @@ -1586,6 +1589,7 @@ class UsersController < ApplicationController attach_copied_obj.container = Project.find(project_id) attach_copied_obj.created_on = Time.now attach_copied_obj.author_id = User.current.id + attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end @@ -1628,6 +1632,7 @@ class UsersController < ApplicationController attach_copied_obj.container = OrgSubfield.find(subfield_id) attach_copied_obj.created_on = Time.now attach_copied_obj.author_id = User.current.id + attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end @@ -1649,6 +1654,7 @@ class UsersController < ApplicationController attach_copied_obj.container = OrgSubfield.find(subfield_id) attach_copied_obj.created_on = Time.now attach_copied_obj.author_id = User.current.id + attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end