What I certainly have the need is for multiple excludes and thus would have to chain 3 or 4 for some of the stored procs I'm porting
I also have some convoluted and with or code which is perhaps more appropriate for another thread -Charles On Jan 30, 2013 7:02 PM, "Jeremy Evans" <[email protected]> wrote: > 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. > > > -- 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.
