News for hackers. Stuff that matters.
Re:10 Most Common Rails Mistakes by oelmekki on Tuesday June 03, 2014 @02:12PM (#7841828)
> it is more natural to say "if current_user" than "if current_user.name != 'Guest'".

It is even more natural to say `if signed_in?` :)

Devise provides such a method that checks for effective auth in warden, afaik (so it should know to make difference between a NullObject and an actual User). It would be easy to implement it yourself :

   def signed_in?
      current_user.is_a? User
   end

There are no comments on this comment yet.