about summary refs log tree commit diff stats
path: root/app/models
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-11 12:12:25 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-11 12:12:25 -0400
commite09aa803cf3905c82c29dbaa9101cc4a4639cc5a (patch)
tree507ffb887044bfbcd2fd5cf89f8fe587654d01ba /app/models
parent3a628945ade35f3ba351ba90e271608520753174 (diff)
downloadthoughts-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.rb8
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