views:

371

answers:

1

Hi there, I am building an Rails App with Authlogic. But I don't want to force the user to fill in the e-mail, or even username! Therefore, I believe i want a methods to skip those validations.. But I don't just want to bypass all other validations.

Is there a method for that in Authlogic, or do I need to hack in the gem?

The reason is that I'm using OpenID by authlogic-oid pluguin, and all I know about this is rbates: http://asciicasts.com/episodes/170-openid-with-authlogic

I get the error primarily from Google (since it don't provide nickname or email)

+1  A: 

Removing validations seems to be a fairly arduous task. You'll need to identify this user somehow in the context of the site, right? Giving them neither a nickname nor an e-mail address to do this with seems not to be an option.

Maybe you should generate a nickname in the before_validation method, based off of the data Google provides, if possible. If Google offers no such helpful data (I haven't worked with its OpenID protocol), randomize or use user ID. (Hello, No-Name 1391!)

Matchu
Awesome answer, worked great! I also added a status field to require additional info later!Ruby openid is very unpredictable
Fabiano PS