diff --git a/CHANGELOG.md b/CHANGELOG.md index ad67a2f97c..51978fd6f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,8 @@ ### Fixed + - Patched a validation check to enable updates for all existing DMP Assistant Orgs [#587](https://github.com/portagenetwork/roadmap/issues/587) + - Fix duplicate guidance choices [#560](https://github.com/portagenetwork/roadmap/issues/560) - Fix 500 error being thrown for GET api/v0/plans [#569](https://github.com/portagenetwork/roadmap/issues/569) diff --git a/app/models/org.rb b/app/models/org.rb index 76c3d04025..4a2e632aed 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -92,9 +92,11 @@ class Org < ApplicationRecord # = Validations = # =============== + # DMP Assistant has some org names that are non-unique in there .downcase form + # TODO: Set `case_sensitive: false` after all such orgs names have been addressed validates :name, presence: { message: PRESENCE_MESSAGE }, uniqueness: { message: UNIQUENESS_MESSAGE, - case_sensitive: false } + case_sensitive: true } validates :is_other, inclusion: { in: BOOLEAN_VALUES, message: PRESENCE_MESSAGE } diff --git a/spec/models/org_spec.rb b/spec/models/org_spec.rb index 00c090c4d6..43a264f7db 100644 --- a/spec/models/org_spec.rb +++ b/spec/models/org_spec.rb @@ -8,8 +8,7 @@ it { subject.name = 'DMP Company' - is_expected.to validate_uniqueness_of(:name).case_insensitive - .with_message('must be unique') + is_expected.to validate_uniqueness_of(:name).with_message('must be unique') } it { is_expected.to allow_values(true, false).for(:is_other) }