[FIX #589] Force birthdate format when saving

This commit is contained in:
Mathieu Magnin 2017-07-25 17:26:40 +02:00
parent 1aabc6c82b
commit 03fde0a502
5 changed files with 25 additions and 16 deletions

View file

@ -2,4 +2,5 @@ class Individual < ActiveRecord::Base
belongs_to :dossier
validates_uniqueness_of :dossier_id
validates :birthdate, format: { with: /\A\d{4}\-\d{2}\-\d{2}\z/, message: "La date n'est pas au format AAAA-MM-JJ" }, allow_nil: true
end