wipe_out

Library for removing and clearing data in Rails ActiveRecord models.

MIT License

Downloads
10.5K
Stars
37
Committers
3

WipeOut

Release blog post, ActiveRecord models: How to remove data in GDPR compliant way

Installation

  1. Add WipeOut to your application's Gemfile:
gem "wipe_out", "~> 1.0"

Check newest release at here.

Usage

Quick example:

Given the following model:

# == Schema Info
#
# Table name: users
#
#  id                  :integer(11)    not null, primary key
#  name                :varchar(11)    not null
#  orders_count        :integer(11)    not null
class User < ActiveRecord::Base
end

We can define custom wipe out plan:

UserWipeOutPlan = WipeOut.build_plan do
  wipe_out :name
  ignore :orders_count
end

and execute it:

User.last.then { |user| UserWipeOutPlan.execute(user) }

It will overwrite data inside name but leave, orders_count untouched.

There is also support for relations and making sure that policies are defined for any added columns.

Read more in getting started doc.

Contributing && Development

See development.md

Package Rankings
Top 29.61% on Rubygems.org
Badges
Extracted from project README
Gem Version
Related Projects