asiniy/rails — comment on commit d84fb14f2d4dc42ad041299c6d34070d3b2673b9
File:  line 0
By asiniy:

Hi!
I new to rails developers community, and if I doing something wrong, don't ban me.

If we validates presence of password_digest when password is blank, we have this error. But it's ugly, I think, especially if model has this structure:

> Class Smth
> has_secure_password
>
> # other validations below
> validates
>end

User wouldn't understand, what means "Password_digest can't be blank" in the first line of array of his errors, developer will spend more time to exclude this error from errors list.

This simple change can reduce spendings, because :password_digest will be validates only if password will present.

Regards, Alex