diff options
Diffstat (limited to 'app/models/blog.rb')
| -rw-r--r-- | app/models/blog.rb | 8 |
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 |
