Files
openfoodnetwork/app/models/webhook_endpoint.rb
David Cook 85c98c6d3e 2. Add model WebhookEndpoint [migration]
This will store the URL for each user that wants a notification.

We probably don't need URL validation (it's not done on Enterprise for example). It could be validated by browser input, and anyway will be validated if the webhook actually works or not.

Inspired by Keygen: https://keygen.sh/blog/how-to-build-a-webhook-system-in-rails-using-sidekiq/
2023-03-07 15:38:50 +11:00

7 lines
159 B
Ruby

# frozen_string_literal: true
# Records a webhook url to send notifications to
class WebhookEndpoint < ApplicationRecord
validates :url, presence: true
end