plataformatec/devise — pull request #2617 by MichalPokorny (2013-09-07 08:11:03+00:00)
Title: Add skip_email_uniqueness option to Devise::Models::Validatable

Hi. I used Devise in a project and my User model had to use `acts_as_paranoid`.
This was a problem when a user was deleted and then added again with the same e-mail,
since Devise checks uniqueness over all records, including deleted ones. I stopped using
Validatable for this reason, but I still needed all the other validations - email presence, regexp,
password length, and so on, so I just copy-pasted the relevant code into my model. It works,
but it's ugly.

With this patch, I could just do this:
```ruby
devise :database_authenticable, :rememberable, :trackable, :validatable, skip_email_uniqueness: true
validates_as_paranoid
validates_uniqueness_of_without_deleted :email
```