File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ Choose version:
69
69
- [ 6.b. Custom Serializer] ( #6b-custom-serializer )
70
70
- [ 6.c. Custom Object Changes] ( #6c-custom-object-changes )
71
71
- [ 6.d. Excluding the Object Column] ( #6d-excluding-the-object-column )
72
+ - [ 6.e. Error handling] ( #6e-error-handling )
72
73
- [ 7. Testing] ( #7-testing )
73
74
- [ 7.a. Minitest] ( #7a-minitest )
74
75
- [ 7.b. RSpec] ( #7b-rspec )
@@ -1450,6 +1451,18 @@ The `object` column ends up storing a lot of duplicate data if you have models t
1450
1451
and that are updated many times. You can save ~ 50% of storage space by removing the column from the
1451
1452
versions table. It's important to note that this will disable ` reify ` and ` where_object ` .
1452
1453
1454
+ ### 6.e. Error handling
1455
+
1456
+ You can change the behavior of error handling when an exception is raised while creating a version, by setting the ` version_error_behavior ` option:
1457
+
1458
+ ``` ruby
1459
+ # config/initializers/paper_trail.rb
1460
+ PaperTrail .config.version_error_behavior = :legacy # (Default) Raise on create, log on update/delete.
1461
+ PaperTrail .config.version_error_behavior = :log # Only log error.
1462
+ PaperTrail .config.version_error_behavior = :exception # Raise exception.
1463
+ PaperTrail .config.version_error_behavior = :silent # No-op.
1464
+ ```
1465
+
1453
1466
## 7. Testing
1454
1467
1455
1468
You may want to turn PaperTrail off to speed up your tests. See [ Turning
You can’t perform that action at this time.
0 commit comments