From a451680cf854feca2df9b2fe32c53a89c0c8f569 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 24 Feb 2016 17:09:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=96=87=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=AE=B0=E5=BD=95=E6=94=BE=E5=9C=A8=E8=A1=A8forwards?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index fb35d8495..654703bd6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1591,7 +1591,9 @@ class UsersController < ApplicationController if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 4 end - attach_copied_obj.save + if attach_copied_obj.save + ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) + end @save_message = attach_copied_obj.errors.full_messages end end @@ -1627,7 +1629,9 @@ class UsersController < ApplicationController if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 4 end - attach_copied_obj.save + if attach_copied_obj.save + ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) + end @save_message = attach_copied_obj.errors.full_messages end end @@ -1685,7 +1689,9 @@ class UsersController < ApplicationController if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end - attach_copied_obj.save + if attach_copied_obj.save + ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) + end unless Project.find(project_id).project_score.nil? Project.find(project_id).project_score.update_attribute(:attach_num, Project.find(project_id).project_score.attach_num + 1) @@ -1724,7 +1730,9 @@ class UsersController < ApplicationController if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end - attach_copied_obj.save + if attach_copied_obj.save + ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) + end unless Project.find(project_id).project_score.nil? Project.find(project_id).project_score.update_attribute(:attach_num, Project.find(project_id).project_score.attach_num + 1) end @@ -1781,7 +1789,9 @@ class UsersController < ApplicationController if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end - attach_copied_obj.save + if attach_copied_obj.save + ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) + end end end elsif params[:send_ids].present? @@ -1815,7 +1825,9 @@ class UsersController < ApplicationController if attach_copied_obj.attachtype == nil attach_copied_obj.attachtype = 1 end - attach_copied_obj.save + if attach_copied_obj.save + ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) + end end end else