e5f5440663
Deep-cloned objects have all their relationships stale. Thus, for a newly deep-cloned revision, `revision.types_de_champs` returns `[]`, even when it actually has associated types de champ. This causes consecutive champs creations and re-ordering to fail in subtle ways, like: ``` procedure.draft_revision.add_type_de_champ(…) procedure.publish_revision! procedure.draft_revision.add_type_de_champ(…) procedure.draft_revision.move_type_de_champ(…) # this will fail ``` As `publish_revision!` created a new stale revision, moving the type de champ fails because not all existing champs are found until the object is refreshed. We don't hit this path in production, because usually only a single operation is made in a request. To fix this, save the new revision before associating it as the draft procedure. (Another option would be to `reload` the revision after creation, but this seems better contained and matches the name of the method.) |
||
---|---|---|
.. | ||
champs | ||
concern | ||
types_de_champ | ||
administrateur_spec.rb | ||
archive_spec.rb | ||
assign_to_spec.rb | ||
attestation_template_spec.rb | ||
avis_spec.rb | ||
bill_signature_spec.rb | ||
champ_private_spec.rb | ||
champ_shared_example.rb | ||
champ_spec.rb | ||
commentaire_spec.rb | ||
deleted_dossier_spec.rb | ||
dossier_spec.rb | ||
dossier_transfer_spec.rb | ||
etablissement_spec.rb | ||
exercice_spec.rb | ||
expert_spec.rb | ||
experts_procedure_spec.rb | ||
export_spec.rb | ||
france_connect_information_spec.rb | ||
france_connect_particulier_client_spec.rb | ||
geo_area_spec.rb | ||
groupe_instructeur_spec.rb | ||
individual_spec.rb | ||
instructeur_spec.rb | ||
invite_spec.rb | ||
procedure_overview_spec.rb | ||
procedure_presentation_and_revisions_spec.rb | ||
procedure_presentation_spec.rb | ||
procedure_revision_spec.rb | ||
procedure_spec.rb | ||
service_spec.rb | ||
siret_spec.rb | ||
super_admin_spec.rb | ||
traitement_spec.rb | ||
trusted_device_token_spec.rb | ||
type_de_champ_private_spec.rb | ||
type_de_champ_shared_example.rb | ||
type_de_champ_spec.rb | ||
user_spec.rb |