I'm trying to combine two case-insensitive LIKE clauses using an OR.

This syntax:

@tags = Tag.where( 
        Sequel.or( Sequel[:name].ilike("%#{params[:name]}%") , Sequel[:
description].ilike("%#{params[:name]}%") )
)


Generates an error:

wrong number of arguments (given 2, expected 1)

When I tried this syntax:

( Sequel[:name].ilike("%#{params[:name]}%") | Sequel[:description].ilike(
"%#{params[:name]}%") )

The query worked as expected.

Is Sequel.or intended to be used in a limited set of cases?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to