Validate unit badge ID with badge_id_valid and improved error messages#297
Merged
stefan-burke merged 4 commits intomainfrom Oct 13, 2025
Merged
Conversation
…xistence Replaced the before_create callback :validate_badge_id with a custom validation method :badge_id_exists on create. This change ensures badge ID validation fits Rails validation conventions and removes unnecessary use of throw(:abort). Adjusted normalize_id method logic and updated related specs accordingly. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
Updated the Unit model's badge ID validation method to properly handle presence and existence checks. Replaced badge_id_exists with badge_id_valid to ensure ID presence before validating badge existence. Adjusted unit spec to reflect the method rename and validation logic. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
The mock_tar_compression helper was failing because FileUtils.touch doesn't create parent directories. Added FileUtils.mkdir_p to ensure the parent directory exists before attempting to create the file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…validation-error-zlhklb
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
Model
Views
Tests
Test plan
Notes
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/6c5d54cd-3d8f-4cb1-a6c4-1599a73e07cc