models: require belong_to associations on invite

This commit is contained in:
Pierre de La Morinerie 2020-07-20 16:56:23 +02:00
parent fe8804f208
commit 802d3804f5
2 changed files with 4 additions and 11 deletions

View file

@ -14,7 +14,7 @@
class Invite < ApplicationRecord
include EmailSanitizableConcern
belongs_to :dossier
belongs_to :dossier, optional: false
belongs_to :user, optional: true
before_validation -> { sanitize_email(:email) }