Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 months 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T08:56:58.000Z (over 1 year ago)
- Last Synced: 2024-10-15T19:41:03.650Z (4 months 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
[![Gem Version](https://badge.fury.io/rb/wipe_out.svg)](https://rubygems.org/gems/wipe_out)
![Library for removing and clearing data in Rails ActiveRecord models](https://www.globalapptesting.com/hs-fs/hubfs/blog_post_title_image_1-14.jpeg?width=1985&name=blog_post_title_image_1-14.jpeg)
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)