From 71542f6a3a947cae0f0be5c1f3ea0167daafcde1 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 19 Apr 2017 10:24:08 +0200 Subject: [PATCH] PiecesJustificativesService: more explicit selection of content --- app/services/pieces_justificatives_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/pieces_justificatives_service.rb b/app/services/pieces_justificatives_service.rb index dd611550b..1298897e5 100644 --- a/app/services/pieces_justificatives_service.rb +++ b/app/services/pieces_justificatives_service.rb @@ -2,7 +2,7 @@ class PiecesJustificativesService def self.upload!(dossier, user, params) tpj_contents = dossier.types_de_piece_justificative .map { |tpj| [tpj, params["piece_justificative_#{tpj.id}"]] } - .select { |_, content| content } + .select { |_, content| content.present? } without_virus, with_virus = tpj_contents .partition { |_, content| ClamavService.safe_file?(content.path) }