Skip to content

This gem extends ActiveAdmin so that batch restore and batch archive actions will be available in resource index page. Also 'All' and 'Archived' scope will be available for resource index page. 'All' scope will show non archived resources and 'Archived' scope will show deleted or archived resources.

License

Notifications You must be signed in to change notification settings

DocSpring/active_admin_paranoia

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

active_admin_paranoia

This gem extends ActiveAdmin so that batch restore and batch archive actions will be available in resource index page. Also 'All' and 'Archived' scope will be available for resource index page. 'All' scope will show non archived resources and 'Archived' scope will show deleted or archived resources.

Installation

This gem assumes that you have already configured paranoia for you desire resource. Add this line to your application's Gemfile:

gem "active_admin_paranoia" , '~> 1.0.11'

And then execute:

$ bundle

Usages

ActiveAdmin.register Post do
  active_admin_paranoia
end

Archiving (soft delete) vs Deleting (hard delete)

The "Archive" button will call #destroy to soft delete the resource by setting the deleted_at column to the current time. The "Delete" button will call #really_destroy! to hard delete the resource (by removing the records from the database).

You can disable hard deletion by removing the :destroy action:

ActiveAdmin.register Post do
  active_admin_paranoia
  actions :all, except: [:destroy]
end

About

This gem extends ActiveAdmin so that batch restore and batch archive actions will be available in resource index page. Also 'All' and 'Archived' scope will be available for resource index page. 'All' scope will show non archived resources and 'Archived' scope will show deleted or archived resources.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%