feat(gallery): add attachments from avis
This commit is contained in:
parent
e95e86faae
commit
d10df6e17c
5 changed files with 99 additions and 8 deletions
|
@ -513,11 +513,16 @@ module Instructeurs
|
|||
.commentaires
|
||||
.includes(piece_jointe_attachments: :blob)
|
||||
.map(&:piece_jointe)
|
||||
.map(&:attachments)
|
||||
.flatten
|
||||
.flat_map(&:attachments)
|
||||
.map(&:id)
|
||||
|
||||
champs_attachments_ids + commentaires_attachments_ids
|
||||
avis_attachments_ids = dossier
|
||||
.avis.flat_map { [_1.introduction_file, _1.piece_justificative_file] }
|
||||
.flat_map(&:attachments)
|
||||
.compact
|
||||
.map(&:id)
|
||||
|
||||
champs_attachments_ids + commentaires_attachments_ids + avis_attachments_ids
|
||||
end
|
||||
@gallery_attachments = ActiveStorage::Attachment.where(id: gallery_attachments_ids)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue