Skip to content

Instantly share code, notes, and snippets.

@t-mart
Created July 2, 2012 20:00
Show Gist options
  • Save t-mart/3035342 to your computer and use it in GitHub Desktop.
Save t-mart/3035342 to your computer and use it in GitHub Desktop.
class AddDeviseLockableColumnsToUser < ActiveRecord::Migration
def change
change_table :users do |t|
t.lockable :maximum_attemps => 3, :lock_strategy => :failed_attempts, :unlock_strategy => :none
end
end
end
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :lockable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
# attr_accessible :title, :body
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment