On Wednesday, January 30, 2013 1:11:13 PM UTC-8, Charles Monteiro wrote:
>
> so the following:
>
>
> view = (table.exclude event_status: 'P').exclude :event_type.like 'v%'
>
>
> generates the correct sql:
>
>
> SELECT * FROM "MY_TABLE" WHERE (("EVENT_STATUS" != 'P') AND ("EVENT_TYPE" 
> NOT LIKE 'v%'))*
> *
>
>
> I tried and was hoping for a terser approach where I was passing multiple 
> args to exclude but for one that does OR and furthermore could not figure 
> out how to pass it the "like" short hand syntax ie. not rely on 
> "Sequel.like etc" 
>

exclude is supposed to be the opposite of filter, which is why it uses (!A 
OR !B) where filter would use (A AND B).  There isn't currently a shorter 
way to do multiple exclusions with AND, though I suppose one could be added 
if people really think it would be useful.

Please speak up if you are for/against such a method.  I'm on the fence, 
partly because I can't think of a good name for such a method, and partly 
because I'm not sure the increased terseness would result in more readable 
code.

Thanks,
Jeremy

-- 
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 http://groups.google.com/group/sequel-talk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to