models: require belong_to associations on attestation

This commit is contained in:
Pierre de La Morinerie 2020-07-20 16:28:51 +02:00
parent c1e2928ce7
commit 1ea4c2aa36
2 changed files with 2 additions and 2 deletions

View file

@ -9,7 +9,7 @@
# dossier_id :integer not null
#
class Attestation < ApplicationRecord
belongs_to :dossier
belongs_to :dossier, optional: false
has_one_attached :pdf

View file

@ -1,7 +1,7 @@
FactoryBot.define do
factory :attestation do
title { 'title' }
dossier { create(:dossier) }
association :dossier
end
trait :with_pdf do