新建的项目发布新问题报500

This commit is contained in:
lizanle 2015-03-06 11:53:16 +08:00
parent 140cb81748
commit 10faab0129
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ class IssuesController < ApplicationController
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@issue.project_issues_index = @issue.project.issues.last.project_issues_index + 1
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
if @issue.save
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format|