diff --git a/app/controllers/forms_controller.rb b/app/controllers/forms_controller.rb index 3d1956b..563aa95 100644 --- a/app/controllers/forms_controller.rb +++ b/app/controllers/forms_controller.rb @@ -34,7 +34,6 @@ class FormsController < ApplicationController end def notification - puts '' @form = current_user.forms.find_by!(token: params[:id]) end diff --git a/app/models/form.rb b/app/models/form.rb index 12d3a77..48f8e28 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -18,7 +18,7 @@ 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, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :update } + validates :notify_email, presence: true, on: :update # TODO: use counter_cache option on association def submissions_count @submissions_count ||= submissions.count