From 43e72813b4d46b05799484ea0869191f72d97fac Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 10 Nov 2016 11:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E6=8C=87=E6=B4=BE=E7=9D=80=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=EF=BC=8C=E5=AF=BC=E5=87=BA=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 8ba2ce20f..a137b7cd1 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -235,7 +235,9 @@ class IssuesController < ApplicationController # 给该issue在它所在的项目中所有的issues中所在的位置给一个序号 @issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1 @issue.fixed_version_id = nil if @issue.fixed_version_id == 0 + @issue.assigned_to_id = nil if @issue.assigned_to_id == 0 if @issue.save + #params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0 senduser = User.find(params[:issue][:assigned_to_id]) issue_id = @issue.id issue_title = params[:issue][:subject] @@ -282,15 +284,18 @@ class IssuesController < ApplicationController # 用户编辑更改issue def update + # params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0 if params[:issue_detail] issue = Issue.find(params[:id]) issue = update_user_issue_detail(issue, params) + @issue.assigned_to_id = nil if @issue.assigned_to_id == 0 @saved = update_user_issue_detail(issue, params) return else # 修改实例变量的值 return unless update_issue_from_params @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) + @issue.assigned_to_id = nil if @issue.assigned_to_id == 0 saved = false begin @saved = @issue.save_issue_with_child_records(params, @time_entry)