资源导入的时候记数没有自动增加问题

This commit is contained in:
huang 2016-04-08 21:30:59 +08:00
parent 3f3048a51b
commit ab34fec172
1 changed files with 4 additions and 0 deletions

View File

@ -2733,6 +2733,10 @@ class UsersController < ApplicationController
attach_copied_obj.attachtype = 4
end
attach_copied_obj.save
# 附件保存成功后更新项目和课程的统计数
if params[:mul_type] == "Project"
mul_container.project_score.update_attribute(:attach_num, mul_container.project_score.attach_num + 1) unless mul_container.project_score.nil?
end
@save_message = attach_copied_obj.errors.full_messages
end
end