A platform for community discussion. Free, open, simple.
DEV: call 'enqueue_hooks' method only if active webhooks exist
Vinoth Kannan27e7f2bee0a0
diff --git a/app/models/concerns/has_destroyed_web_hook.rb b/app/models/concerns/has_destroyed_web_hook.rbindex 081189ff83e..233a80802ca 100644--- a/app/models/concerns/has_destroyed_web_hook.rb+++ b/app/models/concerns/has_destroyed_web_hook.rb@@ -7,11 +7,16 @@ module HasDestroyedWebHookdef enqueue_destroyed_web_hooktype = self.class.name.underscore.to_sym- payload = WebHook.generate_payload(type, self) if WebHook.active_web_hooks(type).exists?- yield- WebHook.enqueue_hooks(type, "#{type}_destroyed".to_sym,- id: id,- payload: payload- )++ if WebHook.active_web_hooks(type).exists?+ payload = WebHook.generate_payload(type, self)+ yield+ WebHook.enqueue_hooks(type, "#{type}_destroyed".to_sym,+ id: id,+ payload: payload+ )+ else+ yield+ endendend