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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Wang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
So, how do I get around it when using mysql & find_by? Michael Wang 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 Wang-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Wang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks. Michael Wang 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 Wang-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---