README.md in authtrail-0.4.1 vs README.md in authtrail-0.4.2
- old
+ new
@@ -14,21 +14,28 @@
```ruby
gem 'authtrail'
```
-To encrypt email and IP addresses, install [Lockbox](https://github.com/ankane/lockbox) and [Blind Index](https://github.com/ankane/blind_index) and run:
+To encrypt email and IP addresses with Lockbox, install [Lockbox](https://github.com/ankane/lockbox) and [Blind Index](https://github.com/ankane/blind_index) and run:
```sh
-rails generate authtrail:install --lockbox
+rails generate authtrail:install --encryption=lockbox
rails db:migrate
```
+To use Active Record encryption (Rails 7+, experimental, unreleased), run:
+
+```sh
+rails generate authtrail:install --encryption=activerecord
+rails db:migrate
+```
+
If you prefer not to encrypt data, run:
```sh
-rails generate authtrail:install
+rails generate authtrail:install --encryption=none
rails db:migrate
```
To enable geocoding, see the [Geocoding section](#geocoding).
@@ -180,9 +187,23 @@
data[:city] = request.headers["<city-header>"]
end
```
Check out [this example](https://github.com/ankane/authtrail/issues/40)
+
+## Data Retention
+
+Delete older data with:
+
+```ruby
+LoginActivity.where("created_at < ?", 2.years.ago).in_batches.delete_all
+```
+
+Delete data for a specific user with:
+
+```ruby
+LoginActivity.where(user_id: 1, user_type: "User").in_batches.delete_all
+```
## Other Notes
We recommend using this in addition to Devise’s `Lockable` module and [Rack::Attack](https://github.com/kickstarter/rack-attack).