plataformatec/devise — pull request #2924 by simao (2014-03-10 17:41:53+00:00)
Title: Use `case_sensitive: false` when validating uniquess using ActiveRecord

Hello,

When using mysql with active record, using `case_sensitive: true` (AR default) causes the validation to be executed using a `BINARY` operator.

This causes some problems because the validation might pass and the insert fail, for example in the case where an existing user's email is `ó@example.com` and the new user's email is `o@example.com`.
The validation would not raise an error, because it uses `BINARY`, but the insert would fail, because there is an index on that column and the index will not use a `BINARY` equivalent to compare both email addresses.

`case_insensitive: false` should be used anyway, since we are just validating emails and two emails with the different case are indeed the same email.

I could not write a test case because sqlite is being used for tests.

Not using this option causes some problems when the user's `email`