mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Relax dependency on ActiveModel::Dirty
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
fdf6a48a7e
commit
bbaaefa995
1 changed files with 3 additions and 1 deletions
|
@ -82,6 +82,7 @@ module Devise
|
|||
return result
|
||||
when TrueClass
|
||||
self.failed_attempts = 0
|
||||
save(:validate => false)
|
||||
when FalseClass
|
||||
# PostgreSQL uses nil as the default value for integer columns set to 0
|
||||
self.failed_attempts ||= 0
|
||||
|
@ -89,10 +90,11 @@ module Devise
|
|||
if attempts_exceeded?
|
||||
lock_access!
|
||||
return :locked
|
||||
else
|
||||
save(:validate => false)
|
||||
end
|
||||
end
|
||||
|
||||
save(:validate => false) if changed?
|
||||
result
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue