diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-25 17:08:25 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-25 17:08:25 +0400 |
commit | ba87b76de1177574e26ad09ca97c30fde76d7a45 (patch) | |
tree | 6b738cca6acdaedbc4e62bd200469a42c7929860 /app/services | |
parent | 6cc4ac7b98b0fb2ba028644fd8dc4e2d89b65e2a (diff) |
Use EventCreateService for notes, merge requests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/event_create_service.rb | 8 | ||||
-rw-r--r-- | app/services/merge_requests/base_merge_service.rb | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/app/services/event_create_service.rb b/app/services/event_create_service.rb index 8ff4dad674c..8d8a5873e62 100644 --- a/app/services/event_create_service.rb +++ b/app/services/event_create_service.rb @@ -42,6 +42,14 @@ class EventCreateService create_event(milestone, current_user, Event::CLOSED) end + def reopen_milestone(milestone, current_user) + create_event(milestone, current_user, Event::REOPENED) + end + + def leave_note(note, current_user) + create_event(note, current_user, Event::COMMENTED) + end + private def create_event(record, current_user, status) diff --git a/app/services/merge_requests/base_merge_service.rb b/app/services/merge_requests/base_merge_service.rb index d0f777d50ec..9bc50d3d16c 100644 --- a/app/services/merge_requests/base_merge_service.rb +++ b/app/services/merge_requests/base_merge_service.rb @@ -8,13 +8,7 @@ module MergeRequests end def create_merge_event(merge_request, current_user) - Event.create( - project: merge_request.target_project, - target_id: merge_request.id, - target_type: merge_request.class.name, - action: Event::MERGED, - author_id: current_user.id - ) + EventCreateService.new.merge_mr(merge_request, current_user) end def execute_project_hooks(merge_request) |