#465: Fixed: creation of pull requests

This commit is contained in:
Vokhmin Alexey V 2015-04-14 23:56:16 +03:00
parent e4fdec318f
commit f9ed845fc7
1 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,7 @@ class Projects::PullRequestsController < Projects::BaseController
authorize to_project, :show?
@pull = to_project.pull_requests.new
@pull.issue = to_project.issues.new
@issue = @pull.issue = to_project.issues.new
set_attrs
authorize @pull
@ -35,6 +35,7 @@ class Projects::PullRequestsController < Projects::BaseController
authorize to_project, :show?
@pull = to_project.pull_requests.new pull_params
@issue = @pull.issue
@pull.issue.assignee_id = (params[:issue] || {})[:assignee_id] if policy(to_project).write?
@pull.issue.user, @pull.issue.project, @pull.from_project = current_user, to_project, @project
@pull.from_project_owner_uname = @pull.from_project.owner.uname