diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-11 12:12:25 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-11 12:12:25 -0400 |
commit | e09aa803cf3905c82c29dbaa9101cc4a4639cc5a (patch) | |
tree | 507ffb887044bfbcd2fd5cf89f8fe587654d01ba /app/models | |
parent | 3a628945ade35f3ba351ba90e271608520753174 (diff) | |
download | thoughts-e09aa803cf3905c82c29dbaa9101cc4a4639cc5a.tar.gz thoughts-e09aa803cf3905c82c29dbaa9101cc4a4639cc5a.tar.bz2 thoughts-e09aa803cf3905c82c29dbaa9101cc4a4639cc5a.zip |
We're on Markdown now
Diffstat (limited to 'app/models')
-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 18f63f1..c12d0dc 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb | |||
@@ -18,6 +18,14 @@ class Blog < ApplicationRecord | |||
18 | self | 18 | self |
19 | end | 19 | end |
20 | 20 | ||
21 | def has_read_more | ||
22 | body.include?("<!--MORE-->") | ||
23 | end | ||
24 | |||
25 | def short_body | ||
26 | body[0..(body.index("<!--MORE-->")-1)] | ||
27 | end | ||
28 | |||
21 | private | 29 | private |
22 | def set_draft_title | 30 | def set_draft_title |
23 | if self.title.blank? and not self.published | 31 | if self.title.blank? and not self.published |