问题
We have users that want to use the same email address for multiple accounts. Our rails app uses omniauth-twitter gem with Devise to authenticate users. When users sign up, email is required but it is not used for authentication.
How do we configure Devise to allow users to use same email when signing up for multiple accounts without getting "email has already been taken" validation error?
回答1:
You can simply remove :validatable from the model devise options.
Validatable creates all needed validations for a user email and password. It's optional, given you may want to create the validations by yourself. Automatically validate if the email is present, unique and its format is valid. Also tests presence of password, confirmation and length.
http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Validatable
来源:https://stackoverflow.com/questions/24250143/configure-devise-allow-same-email-for-multiple-accounts