refactor(dossier): refactor pieces jointes

This commit is contained in:
Eric Leroy-Terquem 2024-07-02 18:45:41 +02:00
parent 3516bae008
commit 3bbcda9c04
No known key found for this signature in database
GPG key ID: 53D8FAECEF207605
3 changed files with 31 additions and 39 deletions

View file

@ -8,11 +8,19 @@ module BlobImageProcessorConcern
end
def representation_required?
attachments.any? { _1.record.class == Champs::TitreIdentiteChamp || _1.record.class == Champs::PieceJustificativeChamp || _1.record.class == Commentaire }
from_champ? || from_messagerie?
end
private
def from_champ?
attachments.any? { _1.record.class == Champs::TitreIdentiteChamp || _1.record.class == Champs::PieceJustificativeChamp }
end
def from_messagerie?
attachments.any? { _1.record.class == Commentaire }
end
def watermark_required?
attachments.any? { _1.record.class == Champs::TitreIdentiteChamp }
end