diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-02-15 16:41:40 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-17 09:39:15 +0300 |
commit | b53d9f8a0ec6c044548fa21a04ba227a0c46d43a (patch) | |
tree | 6c31504b342d79191adfdefec2c2ef6e62c8a4c3 /app/services/issues/move_service.rb | |
parent | c280edd31c6ab7f6eb757552d165efc69fcfbc9a (diff) |
Add scaffold of service that moves issue to another project
Diffstat (limited to 'app/services/issues/move_service.rb')
-rw-r--r-- | app/services/issues/move_service.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb new file mode 100644 index 00000000000..85c0d6192e4 --- /dev/null +++ b/app/services/issues/move_service.rb @@ -0,0 +1,41 @@ +module Issues + class MoveService < Issues::BaseService + def execute(issue_old, project_new) + @issue_old = issue_old + @issue_new = issue_old.dup + @project_new = project_new + + open_new_issue + rewrite_notes + close_old_issue + notify_participants + + @issue_new + end + + private + + def open_new_issue + @issue_new.project = @project_new + @issue_new.save! + + add_note_moved_from + end + + def rewrite_notes + end + + def close_old_issue + add_note_moved_to + end + + def notify_participants + end + + def add_note_moved_from + end + + def add_note_moved_to + end + end +end |