From 0022f3e1ce95b538315fa29fd654eb3a2d923b5d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 13 Oct 2023 14:57:41 -0400 Subject: Fixed display of draft blog posts --- app/models/blog.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models/blog.rb') diff --git a/app/models/blog.rb b/app/models/blog.rb index b677e2b..e640466 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -32,6 +32,14 @@ class Blog < ApplicationRecord slug end + def visible_date + if published + published_at + else + updated_at + end + end + private def set_draft_title if self.title.blank? and not self.published -- cgit 1.4.1