Ok, so I’m lazy, and something about always checking to see if an object
exists before calling one of its methods just strikes me as
In particular, I often do this in code:
if session['user] && session[‘user’].is_admin
I’d really just like to be able to drop of the session[‘user’] check. I
mean, if the object doesn’t even exist, then the method call can’t run,
and the whole thing should probably evaluate to nil, right?
I’m just wondering if there’s a smarter way to go about situations like
this. I’m sure I could add some ugly hacks in here and there, but I
could very easily be overlooking the obvious better solution. Anyone
thought about this before?