DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. To continue case sensitive comparison on the :email attribute in User model, pass `case_sensitive: true` option explicitly to the uniqueness validator.
No deprecation warning
Since case_sensitive seems to be an option since rails 5 this could be added without breaking backwards compatibility:
# devise/models/validatable.rb
if Devise.activerecord51?
validates_uniqueness_of :email, allow_blank: true, if: :will_save_change_to_email?, case_sensitive: true
[...]
Hello @shanehofstetter, thanks for reporting this.
Yeah, that seems like a good solution. Do you want to open a pull request for this or should I assign it for someone else?
Opened a PR for this: https://github.com/plataformatec/devise/pull/5065
I thought this was supposed to already be in the most current released version, but I'm still seeing this deprecation warning come up. I'm running:
ruby 2.6.4
rails 6.0.0
devise 4.7.1
Any ideas why this would be?
@mgmodell have you restarted spring after updating? (it may still have previous version in memory)
Not related: be careful with 2.6.4 (https://bugs.ruby-lang.org/issues/16136)
@Vasfed I killed all spring processes and then, for good measure, I went ahead and restarted my Mac and still I get the warnings.
@mgmodell Can you provide us a sample application that reproduces the issue?
@tegon - Sorry about this (and for taking so long to respond). It turns out the error seems to be coming from devise-multi_email.
How to hide this message on start rspec?
Most helpful comment
Opened a PR for this: https://github.com/plataformatec/devise/pull/5065