summaryrefslogtreecommitdiff
path: root/app/observers
diff options
context:
space:
mode:
authorIzaak Alpert <ialpert@blackberry.com>2013-07-16 17:14:03 -0400
committerIzaak Alpert <ialpert@blackberry.com>2013-07-17 22:48:03 -0400
commitd99594273d57b2d5ed7c748b3185712960b89478 (patch)
tree5f5d6da6011465e3521c7c3ab09ec7a38dbef37a /app/observers
parent128f2845770b7a6d553ee764cdbbe63da5ba9e84 (diff)
downloadgitlab-ce-d99594273d57b2d5ed7c748b3185712960b89478.tar.gz
Style changes from review with @randx
-Some changes around calling origional methods for !for_fork? merge requests. Other changes to follow Change-Id: I009c716ce2475b9efa3fd07aee9215fca7a1c150
Diffstat (limited to 'app/observers')
-rw-r--r--app/observers/merge_request_observer.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/app/observers/merge_request_observer.rb b/app/observers/merge_request_observer.rb
index 2c6cfd2de7f..436645a376f 100644
--- a/app/observers/merge_request_observer.rb
+++ b/app/observers/merge_request_observer.rb
@@ -2,8 +2,7 @@ class MergeRequestObserver < ActivityObserver
observe :merge_request
def after_create(merge_request)
- event_author_id = merge_request.author_id
- if event_author_id
+ if merge_request.author_id
create_event(merge_request, Event.determine_action(merge_request))
end
@@ -24,11 +23,11 @@ class MergeRequestObserver < ActivityObserver
return true if merge_request.merge_event
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
+ 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
)
end
@@ -41,14 +40,13 @@ class MergeRequestObserver < ActivityObserver
notification.reassigned_merge_request(merge_request, current_user) if merge_request.is_being_reassigned?
end
-
def create_event(record, status)
Event.create(
- project: record.target_project,
- target_id: record.id,
- target_type: record.class.name,
- action: status,
- author_id: record.author_id
+ project: record.target_project,
+ target_id: record.id,
+ target_type: record.class.name,
+ action: status,
+ author_id: record.author_id
)
end