deviseでモジュールを追加する方法
change_tableでmigrationを記述
class AddUsersLockable < ActiveRecord::Migration def self.up change_table(:users) do |t| t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both end add_index :users, :unlock_token, :unique => true end def self.down end end
migration実行
rake db:migrate
model修正
lockableを追加した
devise :database_authenticatable, :timeoutable, :recoverable, :rememberable, :trackable, :validatable, :lockable