diff options
author | Long Nguyen <long.polyglot@gmail.com> | 2016-04-28 15:52:23 +0700 |
---|---|---|
committer | Long Nguyen <long.polyglot@gmail.com> | 2016-04-28 15:52:23 +0700 |
commit | f7844a11be6a5f6aa7011bd96f59bf218c4788ea (patch) | |
tree | a3e48956f38f6885a44eba6cb876f46a3fcfce95 /app/services/issues | |
parent | d6d1daf430bbadef953b40975a503e0bb64044fc (diff) | |
download | gitlab-ce-f7844a11be6a5f6aa7011bd96f59bf218c4788ea.tar.gz |
Code refactor and fix broken spec
Diffstat (limited to 'app/services/issues')
-rw-r--r-- | app/services/issues/move_service.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb index 8d41ea5df55..fe5df8f18cb 100644 --- a/app/services/issues/move_service.rb +++ b/app/services/issues/move_service.rb @@ -42,7 +42,7 @@ module Issues def create_new_issue new_params = { id: nil, iid: nil, label_ids: cloneable_label_ids, - milestone: cloneable_milestone_id, + milestone_id: cloneable_milestone_id, project: @new_project, author: @old_issue.author, description: rewrite_content(@old_issue.description) } @@ -51,11 +51,13 @@ module Issues end def cloneable_label_ids - @new_project.labels.where(title: @old_issue.labels.pluck(:title)).pluck(:id) + @new_project.labels + .where(title: @old_issue.labels.pluck(:title)).pluck(:id) end def cloneable_milestone_id - @new_project.milestones.find_by(title: @old_issue.milestone.try(:title)) + @new_project.milestones + .find_by(title: @old_issue.milestone.try(:title)).try(:id) end def rewrite_notes |