From fba2c2bb706aa383334ca81100ec7e3c2fc31d5f Mon Sep 17 00:00:00 2001 From: Darius Kramer Date: Thu, 21 Sep 2017 10:09:05 +0200 Subject: [PATCH] Add default webhook configuration if absent from project --- lib/redmine_webhook/webhook_listener.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/redmine_webhook/webhook_listener.rb b/lib/redmine_webhook/webhook_listener.rb index acc7537..4c1a6eb 100644 --- a/lib/redmine_webhook/webhook_listener.rb +++ b/lib/redmine_webhook/webhook_listener.rb @@ -15,6 +15,7 @@ module RedmineWebhook controller = context[:controller] project = issue.project webhooks = Webhook.where(:project_id => project.project.id) + webhooks = Webhook.where(:project_id => 0) unless webhooks return unless webhooks post(webhooks, issue_to_json(issue, controller)) end @@ -26,6 +27,7 @@ module RedmineWebhook issue = context[:issue] project = issue.project webhooks = Webhook.where(:project_id => project.project.id) + webhooks = Webhook.where(:project_id => 0) unless webhooks return unless webhooks post(webhooks, journal_to_json(issue, journal, controller)) end