Skip to content

Add case-insensitive uniqueness to Category, CategoryType, and Sector#664

Merged
maebeale merged 4 commits intorubyforgood:mainfrom
diti0-dot:main
Jan 18, 2026
Merged

Add case-insensitive uniqueness to Category, CategoryType, and Sector#664
maebeale merged 4 commits intorubyforgood:mainfrom
diti0-dot:main

Conversation

@diti0-dot
Copy link
Copy Markdown
Collaborator

What is the goal of this PR and why is this important?

Add case-insensitive uniqueness validation to Category, CategoryType, and Sector models to prevent duplicate data creation.

How did you approach the change?

Updated model validations from validates_presence_of :name, uniqueness: true to proper validates :name, presence: true, uniqueness: { case_sensitive: false }.

Anything else to add?

No

@maebeale
Copy link
Copy Markdown
Collaborator

@diti0-dot looks like the factories need to be updated to sequences or Faker data instead of hard-coded names?

@diti0-dot
Copy link
Copy Markdown
Collaborator Author

@diti0-dot looks like the factories need to be updated to sequences or Faker data instead of hard-coded names?

@maebeale I’ve updated the factories and added sequences for CategoryType and Sector so that all names are now unique, which should prevent the previous test failures.

@maebeale maebeale merged commit c3ceabe into rubyforgood:main Jan 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add case insensitive uniqueness to Category, CategoryType, and Sector

2 participants