about summary refs log tree commit diff stats
path: root/app/models/blog.rb
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-13 14:57:41 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-13 14:57:41 -0400
commit0022f3e1ce95b538315fa29fd654eb3a2d923b5d (patch)
tree611531f72f9bfa15b59ba13b5141f8b01a7fa8d8 /app/models/blog.rb
parent26a7339889929025495df59776d1a33ca19c77ae (diff)
downloadthoughts-0022f3e1ce95b538315fa29fd654eb3a2d923b5d.tar.gz
thoughts-0022f3e1ce95b538315fa29fd654eb3a2d923b5d.tar.bz2
thoughts-0022f3e1ce95b538315fa29fd654eb3a2d923b5d.zip
Fixed display of draft blog posts
Diffstat (limited to 'app/models/blog.rb')
-rw-r--r--app/models/blog.rb8
1 files changed, 8 insertions, 0 deletions
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
32 slug 32 slug
33 end 33 end
34 34
35 def visible_date
36 if published
37 published_at
38 else
39 updated_at
40 end
41 end
42
35 private 43 private
36 def set_draft_title 44 def set_draft_title
37 if self.title.blank? and not self.published 45 if self.title.blank? and not self.published