Commit 4ee8bd11 authored by Yorick Peterse's avatar Yorick Peterse

Backport ServiceHook#execute from EE

In EE this method takes an additional argument that specifies the name
of the hook to trigger. There is no particular reason to not backport
this to CE, since by default the behaviour remains the same. By
backporting this code we remove the need for prepending ServiceHook with
a module in EE.
parent 379ed169
......@@ -5,8 +5,8 @@ class ServiceHook < WebHook
validates :service, presence: true
# rubocop: disable CodeReuse/ServiceClass
def execute(data)
WebHookService.new(self, data, 'service_hook').execute
def execute(data, hook_name = 'service_hook')
WebHookService.new(self, data, hook_name).execute
end
# rubocop: enable CodeReuse/ServiceClass
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment