[refs #90] new pull optimization

This commit is contained in:
Alexander Machehin 2012-10-02 15:14:31 +06:00
parent e76f9e56a7
commit d948949532
1 changed files with 2 additions and 2 deletions

View File

@ -40,14 +40,14 @@ class Projects::PullRequestsController < Projects::BaseController
@pull.issue.user, @pull.issue.project, @pull.head_project = current_user, base_project, @project
if @pull.valid? # FIXME more clean/clever logics
@pull.save
@pull.save # set pull id
@pull.check(false) # don't make event transaction
if @pull.already?
@pull.destroy
flash.now[:error] = I18n.t('projects.pull_requests.up_to_date', :base_ref => @pull.base_ref, :head_ref => @pull.head_ref)
render :new
else
@pull.check
@pull.send(@pull.status)
redirect_to project_pull_request_path(@pull.base_project, @pull)
end
else