diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-17 04:54:10 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-20 17:10:26 +0300 |
commit | 372cdf4ce5fa124e03e2c93e9d1ed586d489b1d8 (patch) | |
tree | 688c6a582f2e12701ab029c65c459020e08c569f /app/services | |
parent | c86b12bf69828da47dc535021aa3847d61d2d642 (diff) |
Marks pending tasks for an user as done when he merge the MR
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/post_merge_service.rb | 1 | ||||
-rw-r--r-- | app/services/task_service.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/app/services/merge_requests/post_merge_service.rb b/app/services/merge_requests/post_merge_service.rb index 8f25c5e2496..63c2f1f4249 100644 --- a/app/services/merge_requests/post_merge_service.rb +++ b/app/services/merge_requests/post_merge_service.rb @@ -11,6 +11,7 @@ module MergeRequests create_merge_event(merge_request, current_user) create_note(merge_request) notification_service.merge_mr(merge_request, current_user) + task_service.merge_merge_request(merge_request, current_user) execute_hooks(merge_request, 'merge') end diff --git a/app/services/task_service.rb b/app/services/task_service.rb index 8254f16581e..2d65eee854d 100644 --- a/app/services/task_service.rb +++ b/app/services/task_service.rb @@ -54,6 +54,14 @@ class TaskService reassigned_issuable(merge_request, current_user) end + # When merge a merge request we should: + # + # * mark all pending tasks related to the target for the current user as done + # + def merge_merge_request(merge_request, current_user) + mark_as_done(merge_request, current_user) + end + # When we mark a task as done we should: # # * mark all pending tasks related to the target for the user as done |