https://github.com/globalapptesting/wipe_out
Library for removing and clearing data in Rails ActiveRecord models.
https://github.com/globalapptesting/wipe_out
activerecord gdpr ruby ruby-gem ruby-on-rails
Last synced: about 1 year ago
JSON representation
Library for removing and clearing data in Rails ActiveRecord models.
- Host: GitHub
- URL: https://github.com/globalapptesting/wipe_out
- Owner: globalapptesting
- License: mit
- Created: 2021-07-08T05:05:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T08:56:58.000Z (almost 3 years ago)
- Last Synced: 2025-03-26T23:02:29.804Z (about 1 year ago)
- Topics: activerecord, gdpr, ruby, ruby-gem, ruby-on-rails
- Language: Ruby
- Homepage: https://www.rubydoc.info/github/GlobalAppTesting/wipe_out/main/
- Size: 43.9 KB
- Stars: 37
- Watchers: 9
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# WipeOut
[](https://rubygems.org/gems/wipe_out)

Release blog post, [ActiveRecord models: How to remove data in GDPR compliant way](https://www.globalapptesting.com/engineering/activerecord-models-how-to-remove-data-in-gdpr-compliant-way)
## Installation
1. Add WipeOut to your application's Gemfile:
```ruby
gem "wipe_out", "~> 1.0"
```
Check newest release at [here](https://rubygems.org/gems/wipe_out).
## Usage
Quick example:
Given the following model:
```ruby
# == 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:
```ruby
UserWipeOutPlan = WipeOut.build_plan do
wipe_out :name
ignore :orders_count
end
```
and execute it:
```ruby
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](./docs/getting_started.md) doc.
## Contributing && Development
See [development.md](./docs/development.md)