Are you trying to eager load the associated model (to avoid an N + 1 query problem), or are you trying to load the associated model into fields on the parent model?
If it's the former, you're probably better off forgetting about :select
and instead of :joins
using:
ts_params[:sql][:include] = :countries, :listing_images
Now you should be able to call listing.countries
and listing.listing_images
to access child models, as normal.