From 8d16792bd546e918301e9565e93bd890f55e4530 Mon Sep 17 00:00:00 2001 From: Absurdon Date: Mon, 13 Apr 2020 16:01:48 +0000 Subject: [PATCH] FIX User#send_new_password * add to_i to password length as nil.to_i == 0 but nil > 0 throws error --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index f9264be..cfa8629 100755 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -392,7 +392,7 @@ class User < ActiveRecord::Base # This serves multiple functions def send_new_password - generate_password unless self.raw_password&.length > 0 + generate_password unless self.raw_password&.length.to_i > 0 self.save! # TODO: consider moving these two to callbacks