[#2180] Only retain old PJ API when cloning for same admin
This commit is contained in:
parent
d1c0418c89
commit
5e37400834
2 changed files with 16 additions and 0 deletions
|
@ -205,6 +205,10 @@ class Procedure < ApplicationRecord
|
|||
[:notice, :deliberation].each { |attachment| clone_attachment(procedure, attachment) }
|
||||
|
||||
procedure.types_de_champ += PiecesJustificativesService.types_pj_as_types_de_champ(self)
|
||||
if is_different_admin || from_library
|
||||
procedure.types_de_champ.each { |tdc| tdc.options&.delete(:old_pj) }
|
||||
end
|
||||
|
||||
procedure.administrateur = admin
|
||||
procedure.initiated_mail = initiated_mail&.dup
|
||||
procedure.received_mail = received_mail&.dup
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue