I often need to do something like:
def search *keywords
select * from something where column ilike '%first-keyword%' OR
column ilike '%second-keyword%' ......;
end
So, the query would contain an arbitrary amount of OR'd conditions,
depending on how many keywords were passed in to the search function.
I'm having trouble getting sequel to do the right syntax. If I wanted
AND instead of ORs, I could do something like:
query = DB[:table]....
keywords.each { |k| query = query.filter("column ilike ?, "%#{k}%" }
--
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.