From a78abf3a0071d1705adc562f23be1f3a347c6db5 Mon Sep 17 00:00:00 2001 From: Alexis Reigel Date: Mon, 4 Dec 2017 12:51:39 +0100 Subject: use safer .hooks_for instead of .public_send with .public_send we can't make sure that the scope on the model actually exists. --- app/services/system_hooks_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services/system_hooks_service.rb') diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb index 690918b4a00..68c4597a133 100644 --- a/app/services/system_hooks_service.rb +++ b/app/services/system_hooks_service.rb @@ -8,7 +8,7 @@ class SystemHooksService end def execute_hooks(data, hooks_scope = :all) - SystemHook.public_send(hooks_scope).find_each do |hook| # rubocop:disable GitlabSecurity/PublicSend + SystemHook.hooks_for(hooks_scope).find_each do |hook| hook.async_execute(data, 'system_hooks') end end -- cgit v1.2.3