Repository navigation
Conversation
maebeale
marked this pull request as ready for review
October 12, 2026 16:12
maebeale
force-pushed
the
maebeale/organization-name-unique-index
branch
from
October 12, 2026 16:22
499f8a8 to
88e314d
Compare
maebeale
force-pushed
the
maebeale/organization-name-unique-index
branch
5 times, most recently
from
October 12, 2026 23:41
26e00cc to
011d549
Compare
jmilljr24
reviewed
Oct 13, 2026
| content_type: %w[image/png image/jpeg image/webp], | ||
| size: { less_than: 5.megabytes } | ||
| validates :name, presence: true, length: { maximum: 255 } | ||
| NAME_INDEX = "index_organizations_on_name".freeze |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Only the spec used it, so it’s gone now and the spec names the index directly.
The validation handles normal saves; the index is the backstop for two simultaneous saves or writes that skip validation, and that spec checks the backstop.
maebeale
force-pushed
the
maebeale/organization-name-unique-index
branch
4 times, most recently
from
October 14, 2026 12:19
cafb6c6 to
c932536
Compare
maebeale
force-pushed
the
maebeale/organization-name-unique-index
branch
3 times, most recently
from
October 14, 2026 14:26
b4cd373 to
dba9672
Compare
jmilljr24
approved these changes
Oct 14, 2026
Collaborator
Author
|
@jmilljr24 you ok w my running this in production to dedupe the 31 "DELETE" organizations? |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Duplicate organizations could be saved freely, which is why the deduper keeps finding them. A unique index closes the gap for every create path (including races), and the model validation turns it into a form error. The column's case-insensitive collation means "Hope House" and "hope house " collide too. The migration refuses to run while duplicates exist so they get merged first. With names unique, the "two orgs share this name" branches in form auto-processing and the resource-org backfill can no longer happen, so they go. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Nothing in the app rescues the duplicate-name error, so the constant only existed for the spec. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
maebeale
force-pushed
the
maebeale/organization-name-unique-index
branch
from
October 14, 2026 16:12
dba9672 to
3d56352
Compare
Collaborator
I'm 99% confident it's fine to do but its their data and I think it's worth the quick question to ask them to scan the list first before we do it on their behalf. We don't know why they labeled them "delete" even though we could assume. |
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.


🤖 suggested review level: 3 Read 📖 unique index + validation, migration aborts on existing dupes
Organizations can no longer be saved twice under the same name, so the deduper stops refilling.
utf8mb4_unicode_citreatsHope House,hope house, andHope Houseas the same name. The model validation (case_sensitive: false) matches it./organizations/dedupe_indexfirst. Same pattern as Prevent duplicate people with the same name and email #2632.PublicFormSubmission) and theresolve_resource_organizationsbackfill no longer handle two orgs with one name.🤖 Generated with Claude Code