demarches-normaliennes/app/models/individual.rb
2017-08-01 16:47:43 +02:00

6 lines
239 B
Ruby

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