about summary refs log tree commit diff stats
path: root/app/models
diff options
context:
space:
mode:
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