Skip to content

Commit fc98beb

Browse files
author
Matt Swanson
committed
handle nil title on story. closes stringer-rss#20
1 parent 32effaf commit fc98beb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/models/story.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
class Story < ActiveRecord::Base
44
belongs_to :feed
55

6+
UNTITLED = "[untitled]"
7+
68
def headline
7-
self.title[0, 50]
9+
self.title.nil? ? UNTITLED : self.title[0, 50]
810
end
911

1012
def lead

0 commit comments

Comments
 (0)