diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-11-15 16:55:51 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-11-15 16:55:51 +0100 |
commit | 4ee8bd11fa317a99dc0f99ea8d33271e4c9d1a47 (patch) | |
tree | f04ad2c84fc81a8f84f3d569dfe8bacc0477b6b1 /app/models/hooks | |
parent | 379ed169f7a848d5f946e01f08fb8354b7a59d9d (diff) | |
download | gitlab-ce-4ee8bd11fa317a99dc0f99ea8d33271e4c9d1a47.tar.gz |
Backport ServiceHook#execute from EEbackport-service-hook-execute-arguments
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.
Diffstat (limited to 'app/models/hooks')
-rw-r--r-- | app/models/hooks/service_hook.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/hooks/service_hook.rb b/app/models/hooks/service_hook.rb index 7d9f6d89d44..8f305dd7c22 100644 --- a/app/models/hooks/service_hook.rb +++ b/app/models/hooks/service_hook.rb @@ -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 |