[Fix #1479] Validate Avis email format
This commit is contained in:
parent
247526578c
commit
38e1609d73
3 changed files with 28 additions and 2 deletions
|
@ -3,6 +3,8 @@ class Avis < ApplicationRecord
|
|||
belongs_to :gestionnaire
|
||||
belongs_to :claimant, class_name: 'Gestionnaire'
|
||||
|
||||
validates :email, format: { with: Devise.email_regexp, message: "n'est pas valide" }, allow_nil: true
|
||||
|
||||
before_save :clean_email
|
||||
before_create :try_to_assign_gestionnaire
|
||||
after_create :notify_gestionnaire
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue