On May 5, 8:58 pm, Michael Lang <[email protected]> wrote:
> Has the tilde prefix (~) gone away in favor of the invert/exclude methods
> you doc'd?  (didn't see any tips on using tilde).

No, you can still use it, I just didn't think of it while I was
writing.  I'll add it to my todo list.

Generally, I use exclude, unless I need to do something like:

  A OR NOT B

Because exclude ANDs the conditions, you can't use it, so you have to
do:

  filter(:a).or(~:b)

or:

  filter(:a | ~:b)

Though for something as simple as that, I'd probably do:

  exclude(:b).or(:a)

So I mostly use ~ when I have an existing dataset I want to add an OR
NOT condition to, where I can't reorder the method chain.

Long story short, I use ~, &, and | for complex cases that can't be
done easily using the regular method calls.  While it is very helpful
to not have to drop down to SQL and use placeholders, I find regular
method calls more readable than ~, &, and |, so I use regular method
calls where I can.  The code is a little longer, but it's also more
understandable.

> All in all, you've exposed a lot of useful features that should be in my
> every day toolbox (and weren't) in an organized and accessible page. This
> will definitely be one of my primary goto pages.

That's good to hear. Thanks for taking the time to read it and give
feedback.

Jeremy

-- 
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