Load nested association and select count at the same time

Yep ok, but the thing is, you don’t load data from section, you only filter category by the section_id. I’m trying to list all sections (in your situation), with their corresponding categories AND the count of ads. Which is why Postegres is not very happy.

But thanks again for the help :wink:

I’m now looking on this topic : Ecto subqueries with virtual fields? which may help me eventually.

1 Like