I’m trying to do some preloading. but in one of the preloads i want to have a order_by and a limit.
This is what i was doing before. Which is pretty straight forward.
|> Repo.preload(pages: [captures: :platform])
Now i wanted to add a query inside it. Everything i tried with adding the platform failed with a bunched of different errors. As i did not find the right implementation yet.
I ended up with this working:
|> preload(pages: [captures: ^from(c in Capture, order_by: [desc: :id], limit: 1)])
But i cannot figure out how to preload the platform. Someone can help me out?