messagerie: fix 'Invité' label in message sender

This commit is contained in:
Pierre de La Morinerie 2018-09-06 16:08:24 +02:00 committed by gregoirenovel
parent 211674435e
commit 353ab812fc
3 changed files with 22 additions and 1 deletions

View file

@ -5,6 +5,10 @@ module CommentaireHelper
end
end
def commentaire_is_from_guest(commentaire)
commentaire.dossier.invites.map(&:email).include?(commentaire.email)
end
def commentaire_date(commentaire)
is_current_year = (commentaire.created_at.year == Date.current.year)
template = is_current_year ? :message_date : :message_date_with_year