1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Handle nil failed_attempts

This commit is contained in:
Alexander Zubkov 2013-09-02 14:48:19 +04:00
parent 23c5517009
commit b9112d4308

View file

@ -2,6 +2,6 @@
# This is only triggered when the user is explicitly set (with set_user)
Warden::Manager.after_set_user :except => :fetch do |record, warden, options|
if record.respond_to?(:failed_attempts) && warden.authenticated?(options[:scope])
record.update_attribute(:failed_attempts, 0) unless record.failed_attempts.zero?
record.update_attribute(:failed_attempts, 0) unless record.failed_attempts.to_i.zero?
end
end