models: require belong_to associations on individual

This commit is contained in:
Pierre de La Morinerie 2020-07-20 14:53:25 +00:00
parent afb1c33154
commit fe8804f208
5 changed files with 6 additions and 5 deletions

View file

@ -12,7 +12,7 @@
# dossier_id :integer
#
class Individual < ApplicationRecord
belongs_to :dossier
belongs_to :dossier, optional: false
validates :dossier_id, uniqueness: true
validates :gender, presence: true, allow_nil: false, on: :update