journaled 5.1.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/app/models/journaled/audit_log/event.rb +2 -1
- data/lib/journaled/audit_log.rb +1 -0
- data/lib/journaled/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fc4b493edc90534706cd22dbb1fae76cdacc693d95e44734f9ce92db2d0716c
|
4
|
+
data.tar.gz: 46edc5873055e2a4e7ceae9f8dc63c558b331a821826803cd36aa971b42258f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c9871cbc8b6439f9d29e29bbc24068d2a25667eb42003bed42ca016505b463586b8b3bc0b4c33d2f130a76d5dbc70bf7815d41b992def7a8dc4f71e697113e8
|
7
|
+
data.tar.gz: 6770fd7d6a3c92bce0122def374fa1a7e31f74c8a67d8ebeb9c2ccf5e1e02c616aae42274b5fd145e6cd59d6aa7e5b483dca134d8479822652e65c0bd7c1df84
|
data/README.md
CHANGED
@@ -345,6 +345,15 @@ Journaled::AuditLog.with_snapshots do
|
|
345
345
|
end
|
346
346
|
```
|
347
347
|
|
348
|
+
Snapshots can also be enabled globally for all _deletion_ operations. Since
|
349
|
+
`changes` will be empty on deletion, you should consider using this if you care
|
350
|
+
about the contents of any records being deleted (and/or don't have a full audit
|
351
|
+
trail from their time of creation):
|
352
|
+
|
353
|
+
```ruby
|
354
|
+
Journaled::AuditLog.snapshot_on_deletion = true
|
355
|
+
```
|
356
|
+
|
348
357
|
Events with snapshots will continue to populate the `changes` field, but will
|
349
358
|
additionally contain a snapshot with the full state of the user:
|
350
359
|
|
@@ -58,7 +58,8 @@ module Journaled
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def snapshot
|
61
|
-
filtered_attributes if record._log_snapshot || AuditLog.snapshots_enabled
|
61
|
+
filtered_attributes if record._log_snapshot || AuditLog.snapshots_enabled ||
|
62
|
+
(database_operation == 'delete' && AuditLog.snapshot_on_deletion)
|
62
63
|
end
|
63
64
|
|
64
65
|
def actor
|
data/lib/journaled/audit_log.rb
CHANGED
@@ -18,6 +18,7 @@ module Journaled
|
|
18
18
|
mattr_accessor(:default_enqueue_opts) { {} }
|
19
19
|
mattr_accessor(:excluded_classes) { DEFAULT_EXCLUDED_CLASSES.dup }
|
20
20
|
thread_mattr_accessor(:snapshots_enabled) { false }
|
21
|
+
thread_mattr_accessor(:snapshot_on_deletion) { false }
|
21
22
|
thread_mattr_accessor(:_disabled) { false }
|
22
23
|
thread_mattr_accessor(:_force) { false }
|
23
24
|
|
data/lib/journaled/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: journaled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Lipson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-10-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activejob
|