Fix for failed first-ever logins on PostgreSQL where column default is nil
This commit is contained in:
parent
006f48232f
commit
0f0eb4e8ce
|
@ -82,6 +82,8 @@ module Devise
|
|||
when TrueClass
|
||||
self.failed_attempts = 0
|
||||
when FalseClass
|
||||
# PostgreSQL uses nil as the default value for integer columns set to 0
|
||||
self.failed_attempts ||= 0
|
||||
self.failed_attempts += 1
|
||||
if attempts_exceeded?
|
||||
lock_access!
|
||||
|
|
Loading…
Reference in New Issue