Closed monfresh closed 6 years ago
I meant to say, only if the password is not nil, then add an error message saying it needs to be a String.
That's odd, I definitely tested this myself at one point and it was fine. Now I check again and it raises an error!
I think the validator itself just needs to return early with no extra errors if there is a nil or blank password. Other validations should cover the requirement for a password to be present.
Ok, this is fixed in version 1.2.1. Thanks for letting me know!
Hello. Thanks for this great gem! In my app, I am validating the presence of the password, but if it is
nil
, your gem is raising a TypeError, which is preventing the app from displaying a helpful message to the user asking them to fill in the password field.Instead of raising an error, what do you think of adding an error to the record using the
errors.add
convention, with a message saying the password needs to be a String?