summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-02-19 10:18:21 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-02-19 10:18:26 +0000
commit9fc393c23dfa206802fdce162be1e06dca65ab54 (patch)
tree8f307d9728e615aec811fc3fcd6f9a516b0c1f03 /app/services
parentb284ce0428d855600899764a1c9bf0a7f3e88277 (diff)
parent5526458b4bd4cbba9216793429036155e7b7ea0c (diff)
downloadgitlab-ce-9fc393c23dfa206802fdce162be1e06dca65ab54.tar.gz
[ci skip] Merge branch 'master' into 42643-persist-external-ip-of-ingress-controller-gke
* master: (114 commits) Fix Error 500 when viewing a commit with a GPG signature in Geo Remember assignee when moving an issue Add changelog entry Allow oxford commas and spaces before commas in MR issue closing pattern. Don't cache a nil repository root ref to prevent caching issues Add back database changes for Ci::Build Revert "Merge branch 'expired-ci-artifacts' into 'master'" Fix order dependencies in some specs migrate admin:users:* to static bundle correct for missing break statement in dispatcher.js alias create and update actions to new and edit migrate projects:merge_requests:edit to static bundle migrate projects:merge_requests:creations:diffs to static bundle migrate projects:merge_requests:creations:new to static bundle migrate projects:issues:new and projects:issues:edit to static bundle migrate projects:branches:index to static bundle migrate projects:branches:new to static bundle migrate projects:compare:show to static bundle migrate projects:environments:metrics to static bundle migrate projects:milestones:* and groups:milestones:* to static bundle ...
Diffstat (limited to 'app/services')
-rw-r--r--app/services/issues/move_service.rb28
1 files changed, 16 insertions, 12 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb
index 2f511ab44b7..7140890d201 100644
--- a/app/services/issues/move_service.rb
+++ b/app/services/issues/move_service.rb
@@ -19,19 +19,10 @@ module Issues
# on rewriting notes (unfolding references)
#
ActiveRecord::Base.transaction do
- # New issue tasks
- #
@new_issue = create_new_issue
- rewrite_notes
- rewrite_issue_award_emoji
- add_note_moved_from
-
- # Old issue tasks
- #
- add_note_moved_to
- close_issue
- mark_as_moved
+ update_new_issue
+ update_old_issue
end
notify_participants
@@ -41,11 +32,24 @@ module Issues
private
+ def update_new_issue
+ rewrite_notes
+ rewrite_issue_award_emoji
+ add_note_moved_from
+ end
+
+ def update_old_issue
+ add_note_moved_to
+ close_issue
+ mark_as_moved
+ end
+
def create_new_issue
new_params = { id: nil, iid: nil, label_ids: cloneable_label_ids,
milestone_id: cloneable_milestone_id,
project: @new_project, author: @old_issue.author,
- description: rewrite_content(@old_issue.description) }
+ description: rewrite_content(@old_issue.description),
+ assignee_ids: @old_issue.assignee_ids }
new_params = @old_issue.serializable_hash.symbolize_keys.merge(new_params)
CreateService.new(@new_project, @current_user, new_params).execute