= devise_suspendable
devise_suspendable is a simple module which uses the Devise authentication framework Activatable module hooks to provide a simple clean way to suspend an account.
When an account is suspended the date and time of suspension is recorded, as well as an optional reason, for easy reference.
== Setup
(Assumes that you have devise already setup and your device models, e.g. User, are already created)
- Add
gem devise_suspendable
in your Gemfile - Create a migration to update each of your device model(s), e.g. User, that you want to be suspendable
rails g devise_suspendable User
- Run the migration
rake db:migrate
- Mark the model as suspendable
class User < ActiveRecord::Base
devise ..., :activatable, :suspendable
...
end
== Notes
-
:suspendable depends on :activatable
-
This plugin is similar to Lockable and can be used along side it, as long as Lockable is using token or timeouts as the unlock strategy. Lockable is great for failed login tracking, and subsequent locking, suspendable is best for manual account suspension
-
Maintaining your active users is part and parcel of running a web app
== References
== Thanks to
Released under the MIT license
Copyright (c) 2010, 2011 Josh Kalderimis, Amol Kelkar