No commit activity in last 3 years
No release in over 3 years
Deactivate support for Devise.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 3.0.0
 Project Readme

Devise Deactivatable

Deactivatable Support for Devise

Usage

Add it to your Gemfile

gem "devise_deactivatable"

Add the deactivatable module to your model:

class User < ActiveRecord::Base
  devise :database_authenticatable, :deactivatable
end

And add the deactivated_at field to the database through a migration:

class DeviseCreateUsers < ActiveRecord::Migration
  def change
    add_column :users, :deactivated_at, :datetime
  end
end

Model

Deactivate

  u.deactivated?
  u.deactivate!

Scope

  # scope
  User.deactivated

Customerize after_deactivate

class User
  def after_deactivate
    # do something
  end
end

Controller

You can send post request to '/users/deactivate' to deactivate the user. You can also customize the controller.

Contributing

  • Fork it
  • Write your changes
  • Commit
  • Send a pull request

License

Apache License version 2.