.nil? sometimes throws errors

pull/6827/head
friflaj 14 years ago
parent cb4cc5afac
commit db9a677534
  1. 13
      app/models/story.rb

@ -75,14 +75,11 @@ class Story < Issue
end end
def points_display(notsized='-') def points_display(notsized='-')
if story_points.nil? # For reasons I have yet to uncover, activerecord will
return notsized # sometimes return numbers as Fixnums that lack the nil?
end # method. Comparing to nil should be safe.
return notsized if story_points == nil
if story_points == 0 return 'S' if story_points == 0
return 'S'
end
return story_points.to_s return story_points.to_s
end end

Loading…
Cancel
Save