revise_type_de_champ -> replace_tdcs_and_children_by_clones
This commit is contained in:
parent
e7524b3f0d
commit
20288fbb7d
1 changed files with 3 additions and 3 deletions
|
@ -81,7 +81,7 @@ class ProcedureRevision < ApplicationRecord
|
||||||
if tdc.only_present_on_draft?
|
if tdc.only_present_on_draft?
|
||||||
tdc
|
tdc
|
||||||
else
|
else
|
||||||
revise_type_de_champ(coordinate)
|
replace_tdc_and_children_by_clones(coordinate)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -415,7 +415,7 @@ class ProcedureRevision < ApplicationRecord
|
||||||
changes
|
changes
|
||||||
end
|
end
|
||||||
|
|
||||||
def revise_type_de_champ(coordinate)
|
def replace_tdc_and_children_by_clones(coordinate)
|
||||||
cloned_type_de_champ = coordinate.type_de_champ.deep_clone(include: [:types_de_champ]) do |original, kopy|
|
cloned_type_de_champ = coordinate.type_de_champ.deep_clone(include: [:types_de_champ]) do |original, kopy|
|
||||||
PiecesJustificativesService.clone_attachments(original, kopy)
|
PiecesJustificativesService.clone_attachments(original, kopy)
|
||||||
end
|
end
|
||||||
|
@ -437,7 +437,7 @@ class ProcedureRevision < ApplicationRecord
|
||||||
coordinate, tdc = coordinate_and_tdc(stable_id)
|
coordinate, tdc = coordinate_and_tdc(stable_id)
|
||||||
|
|
||||||
if coordinate.child? && !tdc.only_present_on_draft?
|
if coordinate.child? && !tdc.only_present_on_draft?
|
||||||
revise_type_de_champ(coordinate.parent)
|
replace_tdc_and_children_by_clones(coordinate.parent)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue