From 17b851cf084d0b7b61c9a4e5d8b25d3c23291a66 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 30 Jul 2018 20:26:40 +0530 Subject: [PATCH] FEATURE: show last updated date for wiki topics --- lib/topic_view.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/topic_view.rb b/lib/topic_view.rb index 625c9ef4337..8020ba72de2 100644 --- a/lib/topic_view.rb +++ b/lib/topic_view.rb @@ -195,7 +195,11 @@ class TopicView def published_time return nil if desired_post.blank? - desired_post.created_at.strftime('%FT%T%:z') + if desired_post.wiki && desired_post.post_number == 1 && desired_post.revisions.size > 0 + desired_post.revisions.last.updated_at.strftime('%FT%T%:z') + else + desired_post.created_at.strftime('%FT%T%:z') + end end def image_url