I got the following code from a Rails tutorial:
def do_something
# some code here....
if @user.blank?
fail NotAuthenticatedError
return
end
# more code here...
end
Is the return
statement necessary, or is the fail
call sufficient to stop the rest of the code in this method from running? Perhaps it depends on how the NotAuthenticatedError
is handled?