On Wed, Jul 7, 2021 at 4:02 PM Árni Gunnarsson <[email protected]> wrote:

>
> How would one go about solving this problem in Sequel, referring to this
> question
> https://stackoverflow.com/questions/68197629/using-equality-comparison-in-ruby-sequel-librarys-having-block
> ?
>
> that is, using this
>
> query.having do sum(Sequel.case({{column => nil} => 1}, 0)) >
> count.function.* end
>
> with the = operator as in, which gives a syntax error
>
> query.having do sum(Sequel.case({{column => nil} => 1}, 0)) =
> count.function.* end
>

That could never work in Ruby syntax.  You can use =~ instead of = (because
the left hand side is a Sequel object) or use a hash:

  query.having do {sum(Sequel.case({{column => nil} => 1}, 0)) =>
count.function.*} end

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CADGZSSd68JYNncBjkHXoYOA1ijZ%3D9uMcDB3iPr%3D8evDKdLNxVg%40mail.gmail.com.

Reply via email to