diff --git a/app/lib/recovery/exporter.rb b/app/lib/recovery/exporter.rb index 4781896f1..f414df28a 100644 --- a/app/lib/recovery/exporter.rb +++ b/app/lib/recovery/exporter.rb @@ -10,7 +10,7 @@ module Recovery :invites, :traitements, :transfer_logs, - commentaires: { piece_jointe_attachment: :blob }, + commentaires: { piece_jointe_attachments: :blob }, avis: { introduction_file_attachment: :blob, piece_justificative_file_attachment: :blob }, dossier_operation_logs: { serialized_attachment: :blob }, attestation: { pdf_attachment: :blob }, diff --git a/lib/tasks/recovery.rake b/lib/tasks/recovery.rake index 58221765a..c56586f0f 100644 --- a/lib/tasks/recovery.rake +++ b/lib/tasks/recovery.rake @@ -48,7 +48,7 @@ namespace :recovery do rake_puts "Will export #{dossier_ids}" dossiers_with_data = Dossier.where(id: dossier_ids) - .preload(commentaires: { piece_jointe_attachment: :blob }, + .preload(commentaires: { pieces_jointes_attachments: :blob }, avis: { introduction_file_attachment: :blob, piece_justificative_file_attachment: :blob }, dossier_operation_logs: { serialized_attachment: :blob }, attestation: { pdf_attachment: :blob }, @@ -67,7 +67,7 @@ namespace :recovery do blob_keys_for_dossier += dossier.commentaires.flat_map do |commentaire| commentaire_blob_key = [] if commentaire.piece_jointe.attached? - commentaire_blob_key += [commentaire.piece_jointe_attachment.blob.key] + commentaire_blob_key += [commentaire.piece_jointe_attachments.blob.key] end commentaire_blob_key end