Add paper_trail gem to track InventoryItem changes#2448
Merged
albertchae merged 3 commits intomainfrom Jul 26, 2021
Merged
Conversation
bundle exec rails generate paper_trail:install --with-changes This commit did not run the migrations yet
We want to do this for easier querying with sql. https://github.com/paper-trail-gem/paper_trail#postgresql-json-column-type-support This commit runs the migration and saves the schema changes.
5 tasks
edwinthinks
approved these changes
Jul 26, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses part of #2377
Description
Add paper_trail gem for tracking changes to
InventoryItemmodel. This PR is best reviewed commit by commit.578c407 - runs a generator provided by
paper_trailto create theversionstable95a6c11 - as suggested in the issue, change the generated migration to use
jsonbcolumns instead34db4a9 - add tracking to
InventoryItemalong with who made the changeType of change
How Has This Been Tested?
InventoryItemare tracked. I didn't add specs at the moment because I thought that would just be testing that the gem works correctly. I'll add relevant specs when I follow up with the view to see the historical inventory.