From ec3cedc66806e156210435413ad1d725a9f008c6 Mon Sep 17 00:00:00 2001 From: Miguel Michelson Date: Sun, 16 Sep 2018 20:33:18 -0300 Subject: [PATCH] unshift plain text when size more than 1 --- app/models/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 55548a7d..7c9506d8 100755 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -73,7 +73,7 @@ def get_title text = self.plain.split("\n") heading = text.first self.title = heading[0..120] if heading.present? - text.shift # removes first + text.shift if text.size > 1 # removes first self.plain = text.join("\n") end