Introducing: `Journaled::AuditLog`
This release introduces Betterment's Journaled::AuditLog
mixin for ActiveRecord modules. It's similar to audit logging / papertrail-like gems, in that it will record changes to models (insert/update/delete). But instead of storing these changes in a local versions
table (etc), it will emit them in the form of journaled events.
To get started, add has_audit_log
to a model:
class MyModel < ApplicationRecord
has_audit_log
# ...
end
This pairs with the 5.0 release that introduced transactionally-batched journaling. (So, if you're changing several records at once within the scope of a single transaction, you'll only end up enqueuing 1 journaled event job).