Merge pull request #8099 from tchak/remove-dead-code
chore(dossier): cleanup clone champ
This commit is contained in:
commit
885d4ea997
1 changed files with 1 additions and 13 deletions
|
@ -217,7 +217,7 @@ class Champ < ApplicationRecord
|
|||
end
|
||||
|
||||
def clone(dossier:, parent: nil)
|
||||
kopy = deep_clone(only: (private? ? [] : [:value, :value_json]) + [:data, :private, :row, :type, :external_id, :type_de_champ_id],
|
||||
kopy = deep_clone(only: (private? ? [] : [:value, :value_json, :data, :external_id]) + [:private, :row, :type, :type_de_champ_id],
|
||||
include: private? ? [] : [:etablissement, :geo_areas])
|
||||
|
||||
kopy.dossier = dossier
|
||||
|
@ -233,18 +233,6 @@ class Champ < ApplicationRecord
|
|||
kopy
|
||||
end
|
||||
|
||||
def clone_piece_justificative(kopy)
|
||||
piece_justificative_file.open do |tempfile|
|
||||
kopy.piece_justificative_file.attach({
|
||||
io: File.open(tempfile.path),
|
||||
filename: piece_justificative_file.filename,
|
||||
content_type: piece_justificative_file.content_type,
|
||||
metadata: { virus_scan_result: ActiveStorage::VirusScanner::SAFE }
|
||||
})
|
||||
end
|
||||
rescue ActiveStorage::FileNotFoundError, ActiveStorage::IntegrityError
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def champs_for_condition
|
||||
|
|
Loading…
Reference in a new issue