On Tuesday, August 4, 2020 at 10:07:31 AM UTC-7, [email protected] wrote:
>
> Even larger, this follows the block and internal qualifiers, but has an
> undefined method '&':
>
> where{{pcid: freebies_array} &
> (listing[:product_name].ilike(submitted.to_s)) & {listing[:status] =>
> 'active'}}.
>
Hash#& is not defined. Sequel does not modify core Ruby classes by
default. You can do:
where{listing[:product_name].ilike(submitted.to_s) & {pcid: freebies_array}
& {listing[:status] => 'active'}}.
or:
where{listing[:product_name].ilike(submitted.to_s) & {pcid: freebies_array,
listing[:status] => 'active'}}.
or:
where{Sequel.&({pcid: freebies_array},
listing[:product_name].ilike(submitted.to_s), {listing[:status] =>
'active'})}.
or you can use
Sequel.extension :core_extensions
which does define Hash#&.
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/196d1ba6-d1b1-456f-9495-e6b340917028o%40googlegroups.com.