News for hackers. Stuff that matters.
Re:10 Most Common Rails Mistakes by taylorfausak on Tuesday June 03, 2014 @12:25PM (#7841132)
I would much rather have it return a null object instead of nil. You could make it better by adding a #guest? method to your User class.

    if current_user.guest?
Although I don't like how the example given returns an OpenStruct instead of a NullUser, for instance.

There are no comments on this comment yet.