As @ryanb stated, validates_presence_of :password
is fixed in master, but will not be passed. This fix also clears the Password digest can't be blank.
message Password digest can't be blank.
.
So, in the model, you still need to add:
validates :password, presence: true, on: :create
As pointed out by @ henrique-zambon, there is no need to add a validates_presence_of :password_confirmation
. To highlight the password confirmation field without showing this additional message, add an error to this field after you have indicated errors.
Then, to hide the optional Password digest can't be blank.
message Password digest can't be blank.
, you can simply delete it at the top of the form.
= form_for @user do |f| - if @user.errors.any? - @user.errors.delete(:password_digest)
source share