JumpstartLab/curriculum — pull request #28 by ekalive (2012-01-17 23:04:47+00:00)
Title: Update source/projects/jsblogger.markdown

When using Ruby 1.9.3 and Rails 3.1.3, "app/view/articles/_comment.html.erb" will error out. The reason is that it is trying to add a comment block for an empty comment object. This results in distance_of_time_in_words bailing out on "nil" argument for 'comment.created_at'.

The error footprint is below:

Before change: (error occurs in line 70 of action_view/lib/helpers/date_helper.rb)
========================================================
Showing jsblogger/app/views/articles/_comment.html.erb where line #3 raised:

can't convert nil into an exact number
Extracted source (around line #3):

1:

2:

Comment by <%=h comment.author_name %>, Article ID <%= comment.article.id %>

3: <%= distance_of_time_in_words_to_now(comment.created_at) %> ago,