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:
commit
8af46499cc
2 changed files with 3 additions and 1 deletions
|
@ -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|
|
||||
|
|
|
@ -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?,
|
||||
|
|
Loading…
Reference in a new issue