dossier: refactor piece_justificative export helpers

This commit is contained in:
Pierre de La Morinerie 2020-06-24 11:31:36 +00:00
parent b83a76a0a1
commit 84149218db
2 changed files with 3 additions and 2 deletions

View file

@ -701,7 +701,8 @@ class Dossier < ApplicationRecord
end
def attachments_downloadable?
!PiecesJustificativesService.liste_pieces_justificatives(self).empty? && PiecesJustificativesService.pieces_justificatives_total_size(self) < Dossier::TAILLE_MAX_ZIP
PiecesJustificativesService.liste_pieces_justificatives(self).present? \
&& PiecesJustificativesService.pieces_justificatives_total_size(self) < Dossier::TAILLE_MAX_ZIP
end
def linked_dossiers_for(instructeur)