fix für neuigkeiten - leerer eintrag

This commit is contained in:
Andreas Stephanides
2014-01-27 20:58:16 +01:00
parent 97bb4dcbfc
commit c5dab481ec

View File

@@ -50,7 +50,7 @@ self.title
end end
def text_first_words def text_first_words
md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.text md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.text
md[:text].split(" ")[0..100].join(" ")+ " ..." md[:text].split(" ")[0..100].join(" ")+ " ..." unless md[:text].split(" ").empty?
end end
def has_calentries? def has_calentries?
!self.calentries.nil? && !self.calentries.empty? !self.calentries.nil? && !self.calentries.empty?