While I get that `if !dataset.empty?` vs `unless dataset.any?` is a matter 
of taste it seems confusing that `.any?` is a valid method but is not 
equivalent to `!empty?` in terms of query optimisation.

DB[:permissions].any? =>  SELECT * FROM "permissions"

!DB[:permissions].empty? => SELECT 1 AS "one" FROM "permissions" LIMIT 1

I spend my time correcting PRs in my code bases to use !empty? and have had 
to adjust the default rubocop rules on negated ifs and wondered if there 
was any reason for the difference and if not whether you would object to 
such a method being added?

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