JumpstartLab/curriculum — pull request #193 by cupakromer (2012-06-27 01:17:00+00:00)
Title: Update Comment create for Article show method

Due to https://github.com/rails/rails/pull/1437 the behavior of `article.comments.new` has changed. Instead of just creating a new `Comment`, it is aliased to `build`. Which per the documentation [ActiveRecord::Associations::ClassMethods#has_many collection.build](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_many) creates the new object and assigns it to the `@article` Comment collection.

This causes the partial rendering of the `distance_of_time_in_words` to fail with a no method on `nil`.

Additionally, it's not advised to use a one-liner (per notes in JumpstartLab/curriculum#61) `@comment = Comments.new(article_id: @article.id)` due to the `ActiveModel::MassAssignmentSecurity::Error`.