plataformatec/devise — Issue #1515: Devise 2.0, reconfirmable and a new user
Author: mrship
Created: 2011-12-20 19:10:40+00:00
State: open

I've just upgraded to 2.0.RC primarily to use the new reconfirmable logic for changing an email. However, when I sign up as a new user, the ```confirm!``` method in ```Confirmable``` fails to save the newly confirmed user with validation messages about the lack of a password. Looking at the code: (line 47 of confirmable.rb)

```
if self.class.reconfirmable
@bypass_postpone = true
self.email = unconfirmed_email if unconfirmed_email.present?
self.unconfirmed_email = nil
save
else
save(:validate => false)
end
```
the reconfirmable path is validating the new user, whereas the non-reconfirmable path is not. That appears to be causing the validation error. Is it intentional that the validation is required for the reconfirmable path? As far as I can tell there is no way that the password is going to validate as we don't have the password attribute to validate on at that stage.

I may be missing something, but should this not call ```save(:validate => false)``` in both instances?