strange acts_as_authenticated code in account/index action


I’m using the acts_as_authenticated plugin. I have not yet modified the AccountController much. All the default actions are still there untouched.

Then, I noted a strange behaviour: When the user is not logged on and tries to access the account/index action, the redirect to the signup page is not made.

Here’s the code for the index action of the AccountController controller:

say something nice, you goof! something sweet.

def index
redirect_to(:action => ‘signup’) unless logged_in? || User.count > 0

There is the || User.count > 0 ? It is causing me problems, here is why - when the user is not logged in, the logged_in? returns false, but being an OR operation, if the User.count > 0, true prevails, so, it assumes the user is logged in when there is a user in the database.

Here’s the full controller code:

Does anyone know why the author did that?

Thanks in advance,