Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate uniqueness with case_sensitive: true explicitly #3569

Merged

Conversation

kennyadsl
Copy link
Member

Description

This will fix the following deprecation warning

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

Please note that this is not needed for non-text columns since this option is ignored in that case, see:

https://github.com/rails/rails/blob/5665d0867bb34b941db778630d558c7694bb1506/activerecord/lib/active_record/validations/uniqueness.rb#L143-L144

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • [ ] I have updated Guides and README accordingly to this change (if needed)
  • [ ] I have added tests to cover this change (if needed)
  • [ ] I have attached screenshots to this PR for visual changes (if needed)

This will fix the following deprecation warning

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

Please note that this is not needed for non-text columns since
this option is ignored in that case, see:

https://github.com/rails/rails/blob/5665d0867bb34b941db778630d558c7694bb1506/activerecord/lib/active_record/validations/uniqueness.rb#L143-L144
@kennyadsl kennyadsl self-assigned this Mar 28, 2020
@kennyadsl kennyadsl marked this pull request as ready for review March 30, 2020 14:21
Copy link
Contributor

@blocknotes blocknotes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Please team merge this PR soon to slim our CI logs 😄

Copy link
Member

@aldesantis aldesantis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why, but I was 100% sure I had approved this one. 😅

@kennyadsl kennyadsl merged commit 5fed9e4 into solidusio:master Apr 8, 2020
@kennyadsl kennyadsl deleted the kennyadsl/remove-rails-6-1-deprecations branch April 8, 2020 15:45
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.

4 participants