title: When using the lockable module in the Devise gem in Ruby on Rails, why is my failed_attempts field not increasing?
body: <p>When using the lockable module in Devise, why is the <code>failed_attempts</code> field not increasing? Is there something wrong with my setup? <code>failed_attempts</code> does not move from 0 when a login fails with a bad password.</p>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>devise_for :users, controllers: { registrations: 'users/registrations' }
  devise_for :admins, controllers: { registrations: 'admins/registrations' }, skip: [:sessions]
  </code></pre>
  
  <p><strong>schema.rb</strong></p>
  
  <pre><code>create_table "admins", :force =&gt; true do |t|
      ...
      t.integer  "failed_attempts",                       :default =&gt; 0
      t.string   "unlock_token"
      t.datetime "locked_at"
      ...
  end
  
  create_table "users", :force =&gt; true do |t|
      ...
      t.integer  "failed_attempts",                                  :default =&gt; 0
      t.string   "unlock_token"
      t.datetime "locked_at"
      ...
  end
  </code></pre>
  
  <p><strong>user.rb</strong></p>
  
  <pre><code>devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable, :lockable, remember_for: 4.weeks
  </code></pre>
  
  <p><strong>admin.rb</strong></p>
  
  <pre><code>devise :database_authenticatable, :registerable, :recoverable, :trackable, :validatable, :lockable, :timeoutable, timeout_in: 60.minutes
  </code></pre>
  
  <p><strong>devise.rb</strong></p>
  
  <pre><code>config.lock_strategy = :failed_attempts
  config.unlock_keys = [ :email ]
  config.unlock_strategy = :both
  config.maximum_attempts = 3
  config.unlock_in = 1.hour
  </code></pre>
  
  <p><strong>Versions</strong></p>
  
  <pre><code>Rails 3.2.0
  Ruby 1.9.3p194
  Devise 2.1.2
  </code></pre>