summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-25 14:01:52 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-25 14:01:52 +0200
commitf08464c055420f9091512a3f9ec1dc2de960fbde (patch)
tree3cecab42f5fbdb72cf93b102009d00e24565f241 /app/services
parent80daf9a7774fd757a8838f0b49b6384ec7ceb724 (diff)
downloadgitlab-ce-f08464c055420f9091512a3f9ec1dc2de960fbde.tar.gz
Remove author_id_of_changes from app
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services')
-rw-r--r--app/services/merge_requests/auto_merge_service.rb3
-rw-r--r--app/services/merge_requests/base_merge_service.rb4
-rw-r--r--app/services/merge_requests/merge_service.rb3
3 files changed, 4 insertions, 6 deletions
diff --git a/app/services/merge_requests/auto_merge_service.rb b/app/services/merge_requests/auto_merge_service.rb
index 9c9117f4687..e35c03275f2 100644
--- a/app/services/merge_requests/auto_merge_service.rb
+++ b/app/services/merge_requests/auto_merge_service.rb
@@ -9,11 +9,10 @@ module MergeRequests
merge_request.lock
if Gitlab::Satellite::MergeAction.new(current_user, merge_request).merge!(commit_message)
- merge_request.author_id_of_changes = current_user.id
merge_request.merge
notification.merge_mr(merge_request, current_user)
- create_merge_event(merge_request)
+ create_merge_event(merge_request, current_user)
execute_project_hooks(merge_request)
true
diff --git a/app/services/merge_requests/base_merge_service.rb b/app/services/merge_requests/base_merge_service.rb
index dbdb0063074..d0f777d50ec 100644
--- a/app/services/merge_requests/base_merge_service.rb
+++ b/app/services/merge_requests/base_merge_service.rb
@@ -7,13 +7,13 @@ module MergeRequests
NotificationService.new
end
- def create_merge_event(merge_request)
+ 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: merge_request.author_id_of_changes
+ author_id: current_user.id
)
end
diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb
index 80487f661e0..680766140bd 100644
--- a/app/services/merge_requests/merge_service.rb
+++ b/app/services/merge_requests/merge_service.rb
@@ -7,11 +7,10 @@ module MergeRequests
# to target branch
class MergeService < BaseMergeService
def execute(merge_request, current_user, commit_message)
- merge_request.author_id_of_changes = current_user.id
merge_request.merge
notification.merge_mr(merge_request, current_user)
- create_merge_event(merge_request)
+ create_merge_event(merge_request, current_user)
execute_project_hooks(merge_request)
true