i’m using the authentication chapter in the rails recipes book to help
me out, but i ran into a snag…
it uses password_hash and password_salt as the fields for storing the
database info. but in the model, there is a password=(pass) method
that does the work for generating the salt and the encryption.
since “password” isn’t one of the database fields, i’m having
validation problems. i have a ‘validates_presence_of’ for the password
method which works fine, but my problem comes when i am updating a
User record that doesn’t have a password field in the form. i am still
getting the “password can’t be blank” error.
what’s the best workaround for this so i can only use the validations
on “password” when i am updating the password.
i hope that makes sense…