plataformatec/devise — Issue #1490: Validation not applied to authentication_keys
Author: redconfetti
Created: 2011-12-07 20:31:24+00:00
State: open

When authentication keys are configured for a model, validation applied to the model does not check all keys.

For example I'm using the following for my User model.

devise :database_authenticatable, :encryptable, :token_authenticatable, :recoverable, :rememberable, :registerable,
:trackable, :validatable, :authentication_keys => [:email, :domain]

When trying to create a new user with the same email address as another user, but under a different domain name, saving the user object fails.

user.errors.inspect (with some fields omitted):

#["has already been taken"]}>,
@base=#>

I updated to Devise v1.5.2 from v1.4.7 and this still occurs.