On Monday, April 20, 2020 at 11:54:37 AM UTC-7, shreko wrote:
>
> Thanks Jeremy for your generous help. I am getting closer but still not
> there
> I tried:
>
> @rs[:jobs] = Job.where(:id => [100254,100255]).eager(:job_items).all
> @rs[:jobs].each{|job| job.json_serializer_opts = {include: :job_items}}
>
>
>
>
> and got the following error:
>
> Unexpected error while processing request: undefined method
> `json_serializer_opts='
> for #<Job:0x0000000405a0d8>
> Did you mean? json_serializer_opts
>
>
As the error message indicates, I made a mistake. The method takes the
options, there is no separate setter method, so you would need:
@rs[:jobs].each{|job| job.json_serializer_opts(include: :job_items)}
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/02a2d154-0908-49db-94b3-5bb8dae1a4bc%40googlegroups.com.