Case sensitive search?

Hello,

I have a login field in the db. when I give find_by_login(‘Abc’). And
there is no login as ‘Abc’ but there is ‘abc’, then it returns that it
exists. Shouldn’t this be case sensitive by default? If not then how can
I do a case sensitive search?

Rm Rm wrote:

Hello,

I have a login field in the db. when I give find_by_login(‘Abc’). And
there is no login as ‘Abc’ but there is ‘abc’, then it returns that it
exists. Shouldn’t this be case sensitive by default? If not then how can
I do a case sensitive search?

That’s a database thing. E.g. for MySQL:

http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html


Michael W.

Rm Rm wrote:

So, how do I get around it when using mysql & find_by?

If you want to use find_by you’ll need to alter your table. Otherwise
you can write some custom SQL to do the select. Read the page I linked
to in my previous post.


Michael W.

So, how do I get around it when using mysql & find_by?

Michael W. wrote:

Rm Rm wrote:

Hello,

I have a login field in the db. when I give find_by_login(‘Abc’). And
there is no login as ‘Abc’ but there is ‘abc’, then it returns that it
exists. Shouldn’t this be case sensitive by default? If not then how can
I do a case sensitive search?

That’s a database thing. E.g. for MySQL:

http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html


Michael W.

Thanks.

Michael W. wrote:

Rm Rm wrote:

So, how do I get around it when using mysql & find_by?

If you want to use find_by you’ll need to alter your table. Otherwise
you can write some custom SQL to do the select. Read the page I linked
to in my previous post.


Michael W.