[#2180] Keep information that this type de champ was cloned from a PJ
This commit is contained in:
parent
651fd6149b
commit
8cb509d192
3 changed files with 6 additions and 2 deletions
|
@ -37,7 +37,7 @@ class TypeDeChamp < ApplicationRecord
|
|||
belongs_to :parent, class_name: 'TypeDeChamp'
|
||||
has_many :types_de_champ, foreign_key: :parent_id, class_name: 'TypeDeChamp', dependent: :destroy
|
||||
|
||||
store_accessor :options, :cadastres, :quartiers_prioritaires, :parcelles_agricoles
|
||||
store_accessor :options, :cadastres, :quartiers_prioritaires, :parcelles_agricoles, :old_pj
|
||||
|
||||
# TODO simplify after migrating `options` column to (non YAML encoded) JSON
|
||||
class MaybeYaml
|
||||
|
|
|
@ -55,7 +55,10 @@ class PiecesJustificativesService
|
|||
type_champ: TypeDeChamp.type_champs.fetch(:piece_justificative),
|
||||
description: description,
|
||||
order_place: order_place,
|
||||
mandatory: tpj.mandatory
|
||||
mandatory: tpj.mandatory,
|
||||
old_pj: {
|
||||
stable_id: tpj.id
|
||||
}
|
||||
)
|
||||
end
|
||||
if types_de_champ.count > 1
|
||||
|
|
|
@ -396,6 +396,7 @@ describe Procedure do
|
|||
expect(stc.libelle).to eq(ptpj.libelle)
|
||||
expect(stc.description).to eq(ptpj.description)
|
||||
expect(stc.mandatory).to eq(ptpj.mandatory)
|
||||
expect(stc.old_pj[:stable_id]).to eq(ptpj.id)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue