[#835] Add a missing validation to avis
This commit is contained in:
parent
19a6391dc8
commit
9833564863
1 changed files with 1 additions and 0 deletions
|
@ -6,6 +6,7 @@ class Avis < ApplicationRecord
|
|||
belongs_to :claimant, class_name: 'Gestionnaire'
|
||||
|
||||
validates :email, format: { with: Devise.email_regexp, message: "n'est pas valide" }, allow_nil: true
|
||||
validates :claimant, presence: true
|
||||
|
||||
before_validation -> { sanitize_email(:email) }
|
||||
before_create :try_to_assign_gestionnaire
|
||||
|
|
Loading…
Reference in a new issue