Closed ramensoup closed 5 years ago
The if: :password_required?
already does this job. the not_common_password validation only runs when the Devise gem specifies that passwords are required.
included do
validate :not_common_password, if: :password_required?
end
This fix prevents the error "undefined method 'downcase' for nil: NilClass" when the user doesn't set the password.