From e6af9763fdcbcbe2ac7bb44b2cc63e10f6cf8f1d Mon Sep 17 00:00:00 2001 From: Rodrigo Flores Date: Mon, 19 Mar 2012 18:02:33 -0300 Subject: [PATCH] Hook should be on lockable not recoverable and removed an useless comment --- lib/devise/hooks/{recoverable.rb => lockable.rb} | 0 lib/devise/models/lockable.rb | 3 ++- lib/devise/models/recoverable.rb | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) rename lib/devise/hooks/{recoverable.rb => lockable.rb} (100%) diff --git a/lib/devise/hooks/recoverable.rb b/lib/devise/hooks/lockable.rb similarity index 100% rename from lib/devise/hooks/recoverable.rb rename to lib/devise/hooks/lockable.rb diff --git a/lib/devise/models/lockable.rb b/lib/devise/models/lockable.rb index 914e642e..cdc35df0 100644 --- a/lib/devise/models/lockable.rb +++ b/lib/devise/models/lockable.rb @@ -1,3 +1,5 @@ +require "devise/hooks/lockable" + module Devise module Models # Handles blocking a user access after a certain number of attempts. @@ -88,7 +90,6 @@ module Devise # if the user can login or not (wrong password, etc) unlock_access! if lock_expired? - # As failed_attempts is always 0 after sign_in, there is no need to set it to 0 if super && !access_locked? true else diff --git a/lib/devise/models/recoverable.rb b/lib/devise/models/recoverable.rb index 3072dd3c..2a6106e3 100644 --- a/lib/devise/models/recoverable.rb +++ b/lib/devise/models/recoverable.rb @@ -1,5 +1,3 @@ -require "devise/hooks/recoverable" - module Devise module Models