2013-03-26 17:11:38 +01:00
|
|
|
class MergeRequestObserver < BaseObserver
|
2012-10-10 00:25:29 +02:00
|
|
|
cattr_accessor :current_user
|
|
|
|
|
|
|
|
def after_create(merge_request)
|
2013-03-26 16:16:06 +01:00
|
|
|
notification.new_merge_request(merge_request, current_user)
|
2012-10-10 00:25:29 +02:00
|
|
|
end
|
|
|
|
|
2013-02-18 09:40:56 +01:00
|
|
|
def after_close(merge_request, transition)
|
|
|
|
Note.create_status_change_note(merge_request, current_user, merge_request.state)
|
2013-03-28 10:59:06 +01:00
|
|
|
|
|
|
|
notification.close_mr(merge_request, current_user)
|
|
|
|
end
|
|
|
|
|
|
|
|
def after_merge(merge_request, transition)
|
2013-03-28 11:14:53 +01:00
|
|
|
notification.merge_mr(merge_request)
|
2013-02-18 09:40:56 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def after_reopen(merge_request, transition)
|
|
|
|
Note.create_status_change_note(merge_request, current_user, merge_request.state)
|
|
|
|
end
|
|
|
|
|
|
|
|
def after_update(merge_request)
|
2013-04-01 11:25:31 +02:00
|
|
|
notification.reassigned_merge_request(merge_request, current_user) if merge_request.is_being_reassigned?
|
2012-10-10 00:25:29 +02:00
|
|
|
end
|
|
|
|
end
|