Sunday, September 16, 2007

4




I always wondered about the Rails error message:


Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id


I was poking around the Rails source code and found it in:


~/rails/activesupport/lib/active_support/whiny_nil.rb


It's explained in the following blog post. It turns

Wow, that's totally a horrible error message, it's not even grammatically correct, and it sure doesn't give new users any clue as to what is going on.

The Rails error messages are generally horrid, but this one is one of the worst.