fix(fork): dossier forkable when associated objects to champs are not valid
This commit is contained in:
parent
9571981856
commit
fb470c1504
2 changed files with 21 additions and 1 deletions
|
@ -246,7 +246,7 @@ class Champ < ApplicationRecord
|
|||
value_attributes = fork || !private? ? [:value, :value_json, :data, :external_id] : []
|
||||
relationships = fork || !private? ? [:etablissement, :geo_areas] : []
|
||||
|
||||
deep_clone(only: champ_attributes + value_attributes, include: relationships) do |original, kopy|
|
||||
deep_clone(only: champ_attributes + value_attributes, include: relationships, validate: !fork) do |original, kopy|
|
||||
PiecesJustificativesService.clone_attachments(original, kopy)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue