Make saved ID read-only and add tests#298
Merged
stefan-burke merged 2 commits intomainfrom Oct 13, 2025
Merged
Conversation
…y ID - Permit :id param only on unit creation, not on update, when UNIT_BADGES enabled - Display ID as read-only on unit edit form when UNIT_BADGES is enabled - Add feature and request specs to ensure ID is immutable after creation - Prevent ID changes via form or direct requests on updates - Improve user experience by showing badge ID on edit without allowing modification Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
Replaced manual HTML markup for displaying the read-only unit ID with a render call to 'chobble_forms/display_field'. This improves code readability and consistency in the units form view. 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
UI
Backend
Tests
spec/features/units/unit_badges_spec.rb
spec/requests/units/units_spec.rb
Test plan
Notes
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/fb797c38-78b3-4192-9cbf-c8e6f809b5fe