项目与班级资源库导入资源重名时导入异常

This commit is contained in:
daiao 2016-09-28 16:52:02 +08:00
parent 4ea76f4dbc
commit fdca4ea968
1 changed files with 1 additions and 0 deletions

View File

@ -3200,6 +3200,7 @@ class UsersController < ApplicationController
ori = Attachment.find_by_id(send_id)
# 如果该附件已经存课程中,则只更新附件创建时间
mul_container.attachments.each do |att|
@exist = false
if att.id == ori.id || (!att.copy_from.nil? && !ori.copy_from.nil? && att.copy_from == ori.copy_from) || att.copy_from == ori.id || att.id == ori.copy_from
att.created_on = Time.now
att.save