add webhook settings

This commit is contained in:
Alex Turchyn
2023-08-05 15:25:16 +03:00
parent 8929adbe83
commit e4bb5466f5
15 changed files with 198 additions and 18 deletions
+2
View File
@@ -15,6 +15,8 @@ class Account < ApplicationRecord
has_many :users, dependent: :destroy
has_many :encrypted_configs, dependent: :destroy
has_many :templates, dependent: :destroy
has_many :submissions, through: :templates
has_many :submitters, through: :submissions
has_many :active_users, -> { active }, dependent: :destroy,
inverse_of: :account, class_name: 'User'
+1
View File
@@ -25,6 +25,7 @@ class EncryptedConfig < ApplicationRecord
EMAIL_SMTP_KEY = 'action_mailer_smtp'
ESIGN_CERTS_KEY = 'esign_certs'
APP_URL_KEY = 'app_url'
WEBHOOK_URL_KEY = 'webhook_url'
belongs_to :account
+1
View File
@@ -26,6 +26,7 @@
#
class Submission < ApplicationRecord
belongs_to :template
has_one :account, through: :template
belongs_to :created_by_user, class_name: 'User', optional: true
has_many :submitters, dependent: :destroy
+2
View File
@@ -30,6 +30,8 @@
#
class Submitter < ApplicationRecord
belongs_to :submission
has_one :template, through: :submission
has_one :account, through: :template
attribute :values, :string, default: -> { {} }
attribute :slug, :string, default: -> { SecureRandom.base58(14) }