Patch #32897

Rails 6: Pass `case_sensitive: true` option explicitly to the uniqueness validator

Added by Marius BALTEANU 8 months ago. Updated 8 months ago.

Status:ReopenedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:4.2.0

Description

Rails 6 displays deprecation warning for uniqueness validator:

DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. To continue case sensitive comparison on the :identifier attribute in Project model, pass `case_sensitive: true` option explicitly to the uniqueness validator. 

https://github.com/rails/rails/pull/35350

0001-Fix-DEPRECATION-WARNING-Uniqueness-validator-will-no.patch Magnifier (10.6 KB) Marius BALTEANU, 2020-01-28 22:35


Related issues

Related to Redmine - Feature #29914: Migrate to Rails 6 New

Associated revisions

Revision 19478
Added by Go MAEDA 8 months ago

Fix 'DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1.' (#32897).

Patch by Marius BALTEANU.

Revision 19479
Added by Go MAEDA 8 months ago

Reverts r19478 (#32897).

History

#1 Updated by Marius BALTEANU 8 months ago

#2 Updated by Marius BALTEANU 8 months ago

  • File 0001-Fix-DEPRECATION-WARNING-Uniqueness-validator-will-no.patch added

Tests results here.

#3 Updated by Go MAEDA 8 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you for your contribution.

#4 Updated by Marius BALTEANU 8 months ago

  • Status changed from Closed to Reopened

Sorry, I've attached a broken patch, please revert it and will post later the correct one.

#5 Updated by Marius BALTEANU 8 months ago

Here is the correct patch, please revert r19478 and commit this one.

#6 Updated by Go MAEDA 8 months ago

Marius BALTEANU wrote:

Sorry, I've attached a broken patch, please revert it and will post later the correct one.

Done.

#7 Updated by Marius BALTEANU 8 months ago

Go MAEDA wrote:

Marius BALTEANU wrote:

Sorry, I've attached a broken patch, please revert it and will post later the correct one.

Done.

Thanks, patch from #note-5 is the correct one, you can commit it.

#8 Updated by Marius BALTEANU 8 months ago

  • File deleted (0001-Fix-DEPRECATION-WARNING-Uniqueness-validator-will-no.patch)

Also available in: Atom PDF