Git Product home page Git Product logo

devise_suspendable's Introduction

devise_suspendable

devise_suspendable is a simple module which uses the [Devise](github.com/plataformatec/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)

  1. Add ‘gem devise_suspendable` in your Gemfile

  2. 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
  1. Run the migration

rake db:migrate
  1. 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

  • Josh Kalderimis for most of core logic for this gem

  • devise_lastseenable for essentially operating as the base for this gem

  • Jeweler for making it dead simple to write this gem

Released under the MIT license

Copyright © 2010, 2011 Josh Kalderimis, Amol Kelkar, Brian Artiaco

devise_suspendable's People

Contributors

bartiaco avatar davegudge avatar joshk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.