mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Fix for failed first-ever logins on PostgreSQL where column default is nil
This commit is contained in:
parent
006f48232f
commit
0f0eb4e8ce
1 changed files with 2 additions and 0 deletions
|
@ -82,6 +82,8 @@ module Devise
|
||||||
when TrueClass
|
when TrueClass
|
||||||
self.failed_attempts = 0
|
self.failed_attempts = 0
|
||||||
when FalseClass
|
when FalseClass
|
||||||
|
# PostgreSQL uses nil as the default value for integer columns set to 0
|
||||||
|
self.failed_attempts ||= 0
|
||||||
self.failed_attempts += 1
|
self.failed_attempts += 1
|
||||||
if attempts_exceeded?
|
if attempts_exceeded?
|
||||||
lock_access!
|
lock_access!
|
||||||
|
|
Loading…
Reference in a new issue