remored the trailling put and the format validation

This commit is contained in:
Tresor11 2020-07-03 21:21:09 +02:00
parent 5065f620a2
commit 3032b0ae1c
2 changed files with 1 additions and 2 deletions

View File

@ -34,7 +34,6 @@ class FormsController < ApplicationController
end
def notification
puts ''
@form = current_user.forms.find_by!(token: params[:id])
end

View File

@ -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