1
0
Fork 0
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:
Alexander Uvarov 2011-02-18 13:45:18 +05:00 committed by José Valim
parent fdf6a48a7e
commit bbaaefa995

View file

@ -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