4 ms·
> 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
by oelmekki 12y ago
> 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