Feature: Support account/inbox specific webhooks (#562)

This commit is contained in:
Subin T P
2020-02-26 09:44:24 +05:30
committed by GitHub
parent 4d5e7b4adf
commit 7479b5db43
24 changed files with 117 additions and 57 deletions

View File

@@ -2,19 +2,20 @@
#
# Table name: webhooks
#
# id :bigint not null, primary key
# urls :string
# created_at :datetime not null
# updated_at :datetime not null
# account_id :integer
# inbox_id :integer
# id :bigint not null, primary key
# url :string
# webhook_type :integer default("account")
# created_at :datetime not null
# updated_at :datetime not null
# account_id :integer
# inbox_id :integer
#
class Webhook < ApplicationRecord
belongs_to :account
belongs_to :inbox
belongs_to :inbox, optional: true
validates :account_id, presence: true
validates :inbox_id, presence: true
serialize :urls, Array
enum webhook_type: { account: 0, inbox: 1 }
end