FIX User#send_new_password

* add to_i to password length as nil.to_i == 0 but nil > 0 throws error
This commit is contained in:
Absurdon 2020-04-13 16:01:48 +00:00
parent 6f05d47a8d
commit 8d16792bd5

View file

@ -392,7 +392,7 @@ class User < ActiveRecord::Base
# This serves multiple functions # This serves multiple functions
def send_new_password def send_new_password
generate_password unless self.raw_password&.length > 0 generate_password unless self.raw_password&.length.to_i > 0
self.save! self.save!
# TODO: consider moving these two to callbacks # TODO: consider moving these two to callbacks