Hello,

I was wondering a way to escape underscore the following code:

    query_string = param_data['query_string'].gsub(/_/,'\\_')
    query_string = param_data['query_string'].gsub(/%/,'\%')

    profiles = Profile.filter(:deleted => 0).filter(:profile_name.like
(query_string << '%')).select(:profile_name).order(:profile_name).limit
(param_data['limit']).all

This is so that it will use the index on profile_name... it works fine
for escape % sign but not underscore...  This maybe more of a Ruby
string then sequel, but I'm not too sure what is going on.

Tks,

NJChoo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to