On Monday, April 20, 2020 at 8:54:09 AM UTC-7, shreko wrote:
>
> To be more precise, simple models work, what doesn't work are Eager models.
>
> @rs[:jobs] = Job.where(:id => [100,101]).eager(:job_items).all
>
>
>
> I get the jobs, but not the job_items.
>

This is expected.  Dataset#eager does not change JSON output.  You can 
probably do:

  @rs[:jobs].each{|job| job.json_serializer_opts = {include: :job_items}}

This will change the JSON serialization output to include the 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/16baae7f-5962-488a-b3a1-e2e855481958%40googlegroups.com.

Reply via email to