models: require belong_to associations on avis

This commit is contained in:
Pierre de La Morinerie 2020-07-20 14:32:22 +00:00
parent aefdd5d2a1
commit 32e55a6d37
3 changed files with 8 additions and 3 deletions

View file

@ -17,9 +17,9 @@
class Avis < ApplicationRecord
include EmailSanitizableConcern
belongs_to :dossier, inverse_of: :avis, touch: true
belongs_to :dossier, inverse_of: :avis, touch: true, optional: false
belongs_to :instructeur, optional: true
belongs_to :claimant, class_name: 'Instructeur'
belongs_to :claimant, class_name: 'Instructeur', optional: false
has_one_attached :piece_justificative_file
has_one_attached :introduction_file