I want to be able to do something like:
folder |> Folder.descendants(preload: [:contracts]) |> Repo.all
Right now, I'm using the following solution:
folder |> Folder.descendants |> Repo.all |> Enum.map(&Repo.preload(&1, [:contracts]))
which looks very hack-y.
I want to be able to do something like:
folder |> Folder.descendants(preload: [:contracts]) |> Repo.all
Right now, I'm using the following solution:
folder |> Folder.descendants |> Repo.all |> Enum.map(&Repo.preload(&1, [:contracts]))
which looks very hack-y.