On Tuesday, August 4, 2020 at 8:04:22 AM UTC-7, [email protected] wrote:
>
> Hi there. I'm confused about the syntax of filtering records whose status
> is 'active'. I can't format it the way I like (fieldname: 'active')
> because in this join, two tables have the 'status' field.
>
> So I have to include the tablename, then the fieldname, as
> `tablename[:fieldname]`. Even using `tablename[:fieldname] => 'status'` is
> giving me an error.
>
That is because you are not inside a virtual row block. This will work:
where{{tablename[:status] => 'active'}}
Alternatively:
where(Sequel[:tablename][:status] => 'active')
Or with the symbol_aref extension:
where(:tablename[:status] => 'active')
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/0748a556-68bb-4b87-92bb-2240da108071o%40googlegroups.com.