Add support for activity details. #110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although the Activity model holds a description field, this field is used in index and search. If it holds many detailed information about the activity being logged, it could break index layout and add additional stress upon search.
To avoid that, a detail field is added. This new, optional field can hold any additional information required to better describe the activity. This is particularly useful to provide a fully functional auditing log as one can now add details for the entire data changed by the activity while keeping description as narrow as possible.
As the field is optional, the ActivityLogger trait could be used as usual, or include a second parameter with all the desired details to be logged. No additional configuration is required for this to work.
I'm not a native speaker of any of the supported languages in this package, but I've included translations for them. Fell free to change that as needed.
I hope this PR find its way to master. Thanks again for the great package, @jeremykenedy.