Extract a part of #commentaire_is_from_me_class
This commit is contained in:
parent
f9230b85b2
commit
b4eb382e26
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
module CommentaireHelper
|
||||
def commentaire_is_from_me_class(commentaire, connected_user)
|
||||
if commentaire.email == connected_user.email
|
||||
if commentaire_is_from_me(commentaire, connected_user)
|
||||
"from-me"
|
||||
end
|
||||
end
|
||||
|
@ -14,4 +14,10 @@ module CommentaireHelper
|
|||
template = is_current_year ? :message_date : :message_date_with_year
|
||||
I18n.l(commentaire.created_at.localtime, format: template)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def commentaire_is_from_me(commentaire, connected_user)
|
||||
commentaire.email == connected_user.email
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue