Seed data: enable badge creation and linking to units#307
Merged
stefan-burke merged 4 commits intomainfrom Oct 13, 2025
Merged
Conversation
- Created a badge batch and badges to link with units in seed data. - Modified create_unit method to accept and assign badge IDs. - Updated unit factory to support badge association via :with_badge trait. - Enhanced seed completeness spec to account for badge id system column. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…d data test Changed the inspection_count parameter from 1 to 2 in the add_seeds_for_user method call to better test creation of complete inspections with assessments. Also added `# typed: false` to disable Sorbet type checking for this spec file. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
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.
Summary
Changes
db/seeds/units.rb
badge_idand assign the unit'sidto thatbadge_idbadge_idspec/factories/units.rb
:with_badgetrait to seed a unit with an associated badgespec/seeds/assessment_seed_data_completeness_spec.rb
idin thesystem_columnsto reflect system-managed IDsspec/services/seed_data_service_spec.rb
Why
How to test
system_columnsincludeidNotes
badge_idis wired into unit creation. If you prefer a separate relation field (instead of settingUnit.idequal toBadge.id), we can adjust accordingly.🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/dd8e705f-466b-412d-ae63-7f3a469a56c6