Replace Kits with KitItems#5597
Open
dorner wants to merge 2 commits into
Open
Conversation
awwaiid
reviewed
Jun 14, 2026
| @storage_locations = current_organization.storage_locations.active | ||
| @items = current_organization.items.loose.active.alphabetized | ||
| @items = ConcreteItem.where(organization: current_organization).active.alphabetized | ||
| end |
Collaborator
There was a problem hiding this comment.
Add current_organization.concrete_items
awwaiid
reviewed
Jun 14, 2026
|
|
||
| def index | ||
| @kits = current_organization.kits.includes(kit_item: {line_items: :item}).class_filter(filter_params) | ||
| @kits = current_organization.kit_items.includes(line_items: :item).class_filter(filter_params) |
Collaborator
There was a problem hiding this comment.
Note to self: consider renaming kit_items to kits, and therefore these diffs will look different and the semantics are lifted to the rename
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.
This is the semifinal step in the move to finally get rid of kits - in fact, that's what this PR does! The only thing left is a table and a column.
Previous PRs moved from a Kit having an item that had line items, to moving the line items directly to that item (now called a KitItem and part of an STI table).
This PR removes Kits entirely and changes all calling code to only look at the KitItems.
A couple of oddities:
Did some ad-hoc local testing and looks OK. Code was mostly generated by Claude and reviewed by me. Will definitely need some in-depth manual testing.