I am using devise with security extension to validate strong passwords.
When I try to registrate an account with an already taken email, I get the error "email has already been taken" twice in the errors hash.
My user model looks like this:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
# :trackable deleted
devise :database_authenticatable, :registerable, :secure_validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :firstname, :lastname, :password, :password_confirmation, :remember_me
end
Without the security extension (:validatable
instead of :secure_validatable
) I get the error only once.
What am I doing wrong?
P.S. Bonus Question:
How do I prevent certain errors from being raised in the first place? Do I have to manipulate devise's RegistrationsController or is there an option for this?
Had the same problem.
Check if this helps: https://groups.google.com/forum/?fromgroups=#!topic/plataformatec-devise/S0nxv7BK10M
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With