Okay, so going through the https://www.railstutorial.org book, I’m on chapter 6, section 6.3.4 and I come across this “gem” (not the ruby gem).
!!user.authenticate("foobar") # returns true
Okay, so I get !false = true, and !!true = true, but what’s going on here?
Is it because the authenticate method can return false (when it fails to authenticate), so
!user.authenticate("wrong pass") returns true, and
!user.authenticate("right pass") would return false?
So you have to double the bang operators to get the desired boolean values? (that seems to be the case)