service and serializer
This commit is contained in:
parent
b69d8249c5
commit
bf622eb3ed
2 changed files with 2 additions and 6 deletions
|
@ -2,13 +2,9 @@ class CommentaireSerializer < ActiveModel::Serializer
|
|||
attributes :email,
|
||||
:body,
|
||||
:created_at,
|
||||
:attachment
|
||||
:piece_jointe_attachments
|
||||
|
||||
def created_at
|
||||
object.created_at&.in_time_zone('UTC')
|
||||
end
|
||||
|
||||
def attachment
|
||||
object.file_url
|
||||
end
|
||||
end
|
||||
|
|
|
@ -161,7 +161,7 @@ class PiecesJustificativesService
|
|||
|
||||
def pjs_for_commentaires(dossiers)
|
||||
commentaire_id_dossier_id = Commentaire
|
||||
.joins(:piece_jointe_attachment)
|
||||
.joins(:piece_jointe_attachments)
|
||||
.where(dossier: dossiers)
|
||||
.pluck(:id, :dossier_id)
|
||||
.to_h
|
||||
|
|
Loading…
Reference in a new issue