发送文件时,记录放在表forwards中

This commit is contained in:
ouyangxuhua 2016-02-24 17:09:43 +08:00
parent 11231d0ff9
commit a451680cf8
1 changed files with 18 additions and 6 deletions

View File

@ -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