dossiers: make build_default_individual explicit

It avoid the use of callbacks, and may avoid situations where an empty
individual is implicitely created.
This commit is contained in:
Pierre de La Morinerie 2020-01-07 16:59:11 +00:00
parent 5e05556ee8
commit b3558c497d
3 changed files with 12 additions and 8 deletions

View file

@ -15,9 +15,12 @@ FactoryBot.define do
procedure = create(:procedure, :published, :with_type_de_champ, :with_type_de_champ_private)
end
# Assign the procedure to the dossier through the groupe_instructeur
if dossier.groupe_instructeur.nil?
dossier.groupe_instructeur = procedure.defaut_groupe_instructeur
end
dossier.build_default_individual
end
trait :with_entreprise do