We have companies, users and a join table, called employees, which has additional metadata such as ‘salary’.
employees_query = from e in Employee, order_by: e.salary, preload: [:user] company = Repo.preload(company, [employees: employees_query])
preload: [:user] is not working here, I get an
Ecto.Association.NotLoaded instead. Is this the wrong syntax for this query?