plataformatec/devise — Issue #1623: Skip validation for some members in Devise model during password reset
Author: rahul
Created: 2012-02-06 04:54:10+00:00
State: open

My User (Devise) model also has name, city, nation, phone members.

In the create registration page - I ```validates_presence_of :city, :nation, :phone, :name, :email, :on => :create```
In the edit registration page - I ```validates_presence_of :city, :nation, :phone, :name, :on => :update```

Now when I set a new password on forgot_password_page, it asks for the presence of city, nation, phone, name inside ```Devise::PasswordsController#update```

How can I handle selective validations?

I am guessing it should be something like,

```
validates_presence_of :city, :nation, :phone, :name, :on => :update, :if => :not_recovering_password

def not_recovering_password
# what goes here
end
```

Posted in [Stackoverflow] (http://stackoverflow.com/questions/9153251/skip-validation-for-some-members-in-devise-model-during-password-reset)