inline create_list_from_dossier into caller
This commit is contained in:
parent
51b71aaa01
commit
97443e2ff6
1 changed files with 8 additions and 12 deletions
|
@ -1,18 +1,14 @@
|
|||
class ActiveStorage::DownloadableFile
|
||||
def self.create_list_from_dossier(dossier, for_expert = false)
|
||||
dossier_export = PiecesJustificativesService.generate_dossier_export(dossier)
|
||||
pjs = [dossier_export] + PiecesJustificativesService.liste_documents(dossier, for_expert)
|
||||
pjs.map do |piece_justificative|
|
||||
[
|
||||
piece_justificative,
|
||||
"dossier-#{dossier.id}/#{self.timestamped_filename(piece_justificative)}"
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
def self.create_list_from_dossiers(dossiers, for_expert = false)
|
||||
dossiers.flat_map do |dossier|
|
||||
create_list_from_dossier(dossier, for_expert)
|
||||
dossier_export = PiecesJustificativesService.generate_dossier_export(dossier)
|
||||
pjs = [dossier_export] + PiecesJustificativesService.liste_documents(dossier, for_expert)
|
||||
pjs.map do |piece_justificative|
|
||||
[
|
||||
piece_justificative,
|
||||
"dossier-#{dossier.id}/#{self.timestamped_filename(piece_justificative)}"
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue