diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-02-15 13:23:54 +0300 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-02-15 13:23:54 +0300 |
commit | 4567fcfe22e6142772d62423d8333550f2fbc462 (patch) | |
tree | e3ad99fe3239be73b611c26c367afbf5b2c58875 /app/services | |
parent | dd633bc1888453a07474d045eca91a9e66302ce0 (diff) |
Re-organize issue move method calls
Move method calls related to execution of moving an issue into separate
private mothods. The reason is that then these methods can be easily
extended with EE specific code
(https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4550#note_59158691).
Related gitlab-ce#41949
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/issues/move_service.rb | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb index 2f511ab44b7..299b9c6215f 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,6 +32,18 @@ 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, |