Displaying 1 result from an estimated 1 matches for "validate_all_but_password".
2006 Mar 29
5
How to skip password validation when updating other fields?
...login] )
end
=> Won''t work because the password and password_confirmation validations
hit.
Is there any way to skip the validations for the password attributes?
I''ve been thinkin of creating validation method in the user model, that
skips the password-fields like this:
def validate_all_but_password
loop through validations
if the validation name doesn''t equal ''password'' or
''password_confirmation''
run the validation
and then call it before update_attribute.
What do you think, would this be a good practise, or is there another
way to sol...