Allow blank values for the notification email

By default forms do not have that value set
This commit is contained in:
bumi 2020-07-22 16:28:53 +02:00
parent 3032b0ae1c
commit 81ad9dde98

View File

@ -18,7 +18,8 @@ class Form < ApplicationRecord
validates :airtable_api_key, presence: { if: :airtable? }
validates :airtable_app_key, presence: { if: :airtable? }
validates :airtable_table, presence: { if: :airtable? }
validates :notify_email, presence: true, on: :update
validates :notify_email, presence: true, on: :update, allow_blank: true
# TODO: use counter_cache option on association
def submissions_count
@submissions_count ||= submissions.count