summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-15 14:41:40 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-17 07:39:15 +0100
commitb53d9f8a0ec6c044548fa21a04ba227a0c46d43a (patch)
tree6c31504b342d79191adfdefec2c2ef6e62c8a4c3 /app/services
parentc280edd31c6ab7f6eb757552d165efc69fcfbc9a (diff)
downloadgitlab-ce-b53d9f8a0ec6c044548fa21a04ba227a0c46d43a.tar.gz
Add scaffold of service that moves issue to another project
Diffstat (limited to 'app/services')
-rw-r--r--app/services/issues/move_service.rb41
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