Skip to content

Fix case group membership org check for groups saved with a new org - #7326

Merged
compwron merged 1 commit into
mainfrom
fix/case-group-org-validation
Nov 1, 2026
Merged

compwron merged 1 commit into
mainfrom
fix/case-group-org-validation

Conversation

@compwron

@compwron compwron commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Fixes the one red rspec example on main, spec/requests/bulk_court_dates_spec.rb:59: Validation failed: Case group memberships is invalid.

CaseGroupMembership checks that the case and the group belong to the same org. It compared casa_org_ids. When a group and its cases are built together with a brand-new org, as that spec's factory does, the org gets saved through the group first, so the case's casa_org_id is still nil when the membership is validated. Comparing the org records handles that, and is the same as comparing ids once both are persisted.

Tests: every spec file that mentions case_group, 62 examples, 0 failures, including the previously failing bulk_court_dates_spec.

🤖 Generated with Claude Code

When a group and its cases are saved together with a new org, the org is
saved through the group first and the case's casa_org_id is still nil,
so the id comparison rejected a valid group (bulk_court_dates_spec:59).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ruby Touches Ruby code label Nov 1, 2026
@compwron
compwron merged commit 3f7d397 into main Nov 1, 2026
12 checks passed
@compwron
compwron deleted the fix/case-group-org-validation branch November 1, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Touches Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant