gitlab-org--gitlab-foss/app/models/hooks/service_hook.rb
Yorick Peterse 4ee8bd11fa
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.
2018-11-15 16:55:51 +01:00

12 lines
318 B
Ruby

# frozen_string_literal: true
class ServiceHook < WebHook
belongs_to :service
validates :service, presence: true
# rubocop: disable CodeReuse/ServiceClass
def execute(data, hook_name = 'service_hook')
WebHookService.new(self, data, hook_name).execute
end
# rubocop: enable CodeReuse/ServiceClass
end