From ba8511fe4052622e9b5c5903af53edbab8c0e217 Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Sun, 13 Aug 2017 16:09:15 +0200 Subject: [PATCH] Fall back on RFC update time when there are no comments --- app/views/request_for_comments/index.html.slim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/request_for_comments/index.html.slim b/app/views/request_for_comments/index.html.slim index 34316dd0..a081dd55 100644 --- a/app/views/request_for_comments/index.html.slim +++ b/app/views/request_for_comments/index.html.slim @@ -37,7 +37,6 @@ h1 = RequestForComment.model_name.human(count: 2) td = request_for_comment.comments_count td = request_for_comment.user.displayname td = t('shared.time.before', time: distance_of_time_in_words_to_now(request_for_comment.created_at)) - //- last_comment = request_for_comment.last_comment || request_for_comment.comments.order('created_at DESC').try(:first).try(:updated_at) - td = t('shared.time.before', time: distance_of_time_in_words_to_now(request_for_comment.last_comment)) + td = t('shared.time.before', time: distance_of_time_in_words_to_now(request_for_comment.last_comment.nil? ? request_for_comment.updated_at : request_for_comment.last_comment)) = render('shared/pagination', collection: @request_for_comments) \ No newline at end of file