To be not, or not to be not?

R

Ruby Freak

That is not the question

Code in question:

module AuthenticatedSystem
protected

# Returns true or false if the user is logged in.
# Preloads @current_user with the user model if they're logged in.
def logged_in?
!!current_user
end
....

Is !! as simple as it looks, or does it have meaning beyond a double
negative? Google doesn't recognize !! in a search.

I see it as "Not (current_user == Nil)"




....
 
Y

Yossef Mendelssohn

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top