models: require belong_to associations on commentaire

This commit is contained in:
Pierre de La Morinerie 2020-07-20 16:34:42 +02:00
parent 32e55a6d37
commit dd1bed9340
3 changed files with 9 additions and 11 deletions

View file

@ -12,7 +12,7 @@
# user_id :bigint
#
class Commentaire < ApplicationRecord
belongs_to :dossier, inverse_of: :commentaires, touch: true
belongs_to :dossier, inverse_of: :commentaires, touch: true, optional: false
belongs_to :user, optional: true
belongs_to :instructeur, optional: true