README.md in authtrail-0.2.1 vs README.md in authtrail-0.2.2
- old
+ new
@@ -2,11 +2,11 @@
Track Devise login activity
:tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
-[![Build Status](https://travis-ci.org/ankane/authtrail.svg?branch=master)](https://travis-ci.org/ankane/authtrail)
+[![Build Status](https://github.com/ankane/authtrail/workflows/build/badge.svg?branch=master)](https://github.com/ankane/authtrail/actions)
## Installation
Add this line to your application’s Gemfile:
@@ -40,18 +40,34 @@
## Features
Exclude certain attempts from tracking - useful if you run acceptance tests
```ruby
-AuthTrail.exclude_method = lambda do |info|
- info[:identity] == "capybara@example.org"
+AuthTrail.exclude_method = lambda do |data|
+ data[:identity] == "capybara@example.org"
end
```
+Add or modify data (also add new fields to the `login_activities` table)
+
+```ruby
+AuthTrail.transform_method = lambda do |data, request|
+ data[:request_id] = request.request_id
+end
+```
+
+Store the user on failed attempts
+
+```ruby
+AuthTrail.transform_method = lambda do |data, request|
+ data[:user] ||= User.find_by(email: data[:identity])
+end
+```
+
Write data somewhere other than the `login_activities` table
```ruby
-AuthTrail.track_method = lambda do |info|
+AuthTrail.track_method = lambda do |data|
# code
end
```
Use a custom identity method