Case sensitive validate_uniqueness_of isn't working

17 views
Skip to first unread message

Emilio Tagua

unread,
Mar 18, 2008, 12:30:24 PM3/18/08
to rubyonra...@googlegroups.com
Hi,

validate_uniqueness_of has the option :case_sensitive, this option is
true by default, there are tests to check that :case_sensitive =>
false is working, but there isn't any test to check that, when set to
true (the default!), is working, in fact it doesn't work at.

There isn't a database agnostic way to do a case sensitive search,
there is in myql (binary like) and sqlite (is case sensitive), but not
a general solution.

I did this patch that add the test to check that case sensitivity is
working and get it to work by doing a ruby (case sensitive) comparison
if case sensitive option is given. To achieve this i changed the find
for a select_all with a construct_finder_sql, so in case it must
compare the value the results aren't objects to be initialitated.

You can find the ticket/patch here:

http://dev.rubyonrails.org/ticket/11366


Thank you.

Reply all
Reply to author
Forward
0 new messages