Forum: Ruby on Rails :case_sensitive => false not working with postgresql

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1383bed6ccf3fb78f8eb474adc4dbf11?d=identicon&s=25 Ben (Guest)
on 2006-05-14 18:22
(Received via mailing list)
Hi,

I'm trying to get login validations to be case insensitive. After doing
some research, I found out that postgres and sqlite are case sensitive
by default.

This changeset (http://dev.rubyonrails.org/changeset/4207) should fix
the bug. I'm running rails 1.1.2. I can't figure out if this is part of
my version of rails, or if I'd have to move to edge to get the
functionality.

My code simply looks like this:

validates_uniqueness_of :login, :case_sensitive => false

However, entering login variants such as "test", "Test", "tEST" creates
these logins without complaint. Not exactly what I want.

Is there a way to attach the condition sql manually?

Thanks!

Ben
This topic is locked and can not be replied to.