1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/hooks/lockable.rb
José Valim 4a24667e80 Revert "Rails 3.2.7 deprecates update_attribute in favor of update_column"
Rails 3.2.8 is rolling back the deprecations.

This reverts commit 7d41072c0e.
2012-08-05 09:24:10 -03:00

7 lines
370 B
Ruby

# After each sign in, if resource responds to failed_attempts, sets it to 0
# 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)
end
end