Merge pull request #8163 from tchak/fix-champ-in-patron

fix(patron): dossier should have a procedure and champ should delegate to dossier
This commit is contained in:
Paul Chavard 2022-11-30 11:07:40 +01:00 committed by GitHub
commit 8af46499cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -75,6 +75,7 @@ class RootController < ApplicationController
end
@dossier = Dossier.new(champs_public: all_champs)
@dossier.association(:procedure).target = Procedure.new
all_champs.each do |champ|
champ.association(:dossier).target = @dossier
champ.champs.each do |champ|

View file

@ -31,9 +31,10 @@ class Champ < ApplicationRecord
belongs_to :etablissement, optional: true, dependent: :destroy
has_many :champs, -> { ordered }, foreign_key: :parent_id, inverse_of: :parent, dependent: :destroy
delegate :procedure, to: :dossier
delegate :libelle,
:type_champ,
:procedure,
:description,
:drop_down_list_options,
:drop_down_other?,