diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-04-26 14:35:34 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-04-26 14:35:34 -0300 |
commit | 1d0a0b9ae7460162176fea4b775068ff1c038048 (patch) | |
tree | 78d84e1cc271c47a0123fc7fa6faca68079df855 /lib/github | |
parent | 8e7f45706a1c0f6cfa5056b89351fb07e4bcd868 (diff) | |
download | gitlab-ce-1d0a0b9ae7460162176fea4b775068ff1c038048.tar.gz |
Fix a failing Rubocop rule on master
Diffstat (limited to 'lib/github')
-rw-r--r-- | lib/github/import.rb | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb index 3e9162ffb9d..d49761fd6c6 100644 --- a/lib/github/import.rb +++ b/lib/github/import.rb @@ -171,24 +171,28 @@ module Github begin restore_branches(pull_request) - author_id = user_id(pull_request.author, project.creator_id) - merge_request.iid = pull_request.iid - merge_request.title = pull_request.title - merge_request.description = format_description(pull_request.description, pull_request.author) - merge_request.source_project = pull_request.source_project - merge_request.source_branch = pull_request.source_branch_name - merge_request.source_branch_sha = pull_request.source_branch_sha - merge_request.target_project = pull_request.target_project - merge_request.target_branch = pull_request.target_branch_name - merge_request.target_branch_sha = pull_request.target_branch_sha - merge_request.state = pull_request.state - merge_request.milestone_id = milestone_id(pull_request.milestone) - merge_request.author_id = author_id - merge_request.assignee_id = user_id(pull_request.assignee) - merge_request.created_at = pull_request.created_at - merge_request.updated_at = pull_request.updated_at - merge_request.save!(validate: false) + author_id = user_id(pull_request.author, project.creator_id) + description = format_description(pull_request.description, pull_request.author) + + merge_request.attributes = { + iid: pull_request.iid, + title: pull_request.title, + description: description, + source_project: pull_request.source_project, + source_branch: pull_request.source_branch_name, + source_branch_sha: pull_request.source_branch_sha, + target_project: pull_request.target_project, + target_branch: pull_request.target_branch_name, + target_branch_sha: pull_request.target_branch_sha, + state: pull_request.state, + milestone_id: milestone_id(pull_request.milestone), + author_id: author_id, + assignee_id: user_id(pull_request.assignee), + created_at: pull_request.created_at, + updated_at: pull_request.updated_at + } + merge_request.save!(validate: false) merge_request.merge_request_diffs.create # Fetch review comments |