models: require belong_to associations on type_de_champ
- Make `type_de_champ.procedure` a requirement; - Move the procedure_id assignation to `before_validation` (otherwise the record is invalid, and never gets saved);
This commit is contained in:
parent
6328011f60
commit
5a7bd24fba
3 changed files with 6 additions and 4 deletions
|
@ -7,6 +7,8 @@ FactoryBot.define do
|
|||
mandatory { false }
|
||||
add_attribute(:private) { false }
|
||||
|
||||
association :procedure
|
||||
|
||||
factory :type_de_champ_text do
|
||||
type_champ { TypeDeChamp.type_champs.fetch(:text) }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue