link children tdc by ProcedureRevisionTypeDeChamp
This commit is contained in:
parent
ce0a592f3c
commit
64175db4dd
1 changed files with 11 additions and 2 deletions
|
@ -188,8 +188,17 @@ FactoryBot.define do
|
||||||
end
|
end
|
||||||
|
|
||||||
trait :with_types_de_champ do
|
trait :with_types_de_champ do
|
||||||
after(:build) do |type_de_champ, _evaluator|
|
after(:build) do |type_de_champ, evaluator|
|
||||||
build(:type_de_champ, libelle: 'sub type de champ', parent: type_de_champ)
|
tdc = build(:type_de_champ, libelle: 'sub type de champ', parent: type_de_champ)
|
||||||
|
|
||||||
|
evaluator.procedure.save
|
||||||
|
|
||||||
|
ProcedureRevisionTypeDeChamp.create!(
|
||||||
|
revision_id: evaluator.procedure.active_revision.id,
|
||||||
|
type_de_champ_id: tdc.id,
|
||||||
|
parent_id: tdc.parent.revision_type_de_champ.id,
|
||||||
|
position: 0
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue