Skip to content

Add paper_trail gem to track InventoryItem changes#2448

Merged
albertchae merged 3 commits intomainfrom
paper_trail
Jul 26, 2021
Merged

Add paper_trail gem to track InventoryItem changes#2448
albertchae merged 3 commits intomainfrom
paper_trail

Conversation

@albertchae
Copy link
Copy Markdown
Collaborator

Addresses part of #2377

Description

Add paper_trail gem for tracking changes to InventoryItem model. This PR is best reviewed commit by commit.

578c407 - runs a generator provided by paper_trail to create the versions table
95a6c11 - as suggested in the issue, change the generated migration to use jsonb columns instead
34db4a9 - add tracking to InventoryItem along with who made the change

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • I tested locally that changes to InventoryItem are 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.

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.
@albertchae albertchae merged commit 16f1486 into main Jul 26, 2021
@seanmarcia seanmarcia deleted the paper_trail branch July 27, 2021 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants