plataformatec/devise — Issue #1479: Can't use Lockable with lock_strategy=:none
Author: igorbernstein
Created: 2011-12-01 08:58:39+00:00
State: open

```ruby
# migration:
create_table(:users) do |t|
t.database_authenticatable
t.lockable :lock_strategy => :none, :unlock_strategy => :none
end

# model
class User < ActiveRecord::Base
devise :database_authenticatable, :lockable
end

# somewhere else
u = User.create!(:email => "a@b.com", :password => "password", :password_confirmation => "password")
u.password = u.password_confirmation = "wrong"
u.valid_for_authentication? # NoMethodError: undefined method `failed_attempts=' for #
```

The problem appears to be that Devise::Models::Lockable#valid_for_authentication? assumes that it has to update the failed_attempts column without checking for its existence.