Add default webhook configuration if absent from project

This commit is contained in:
Darius Kramer
2017-09-21 10:09:05 +02:00
committed by GitHub
parent cb8c6fda11
commit fba2c2bb70

View File

@@ -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