Skip to content

Commit

Permalink
Update lib/ecto/repo/preloader.ex
Browse files Browse the repository at this point in the history
Co-authored-by: José Valim <[email protected]>
  • Loading branch information
greg-rychlewski and josevalim authored Dec 21, 2023
1 parent 50a3fbd commit 64eb7dd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ecto/repo/preloader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,10 @@ defmodule Ecto.Repo.Preloader do
if Keyword.has_key?(query_assocs, preload) do
{assocs, [{info, sub_preloads, true} | throughs], embeds}
else
through =
{_, _, through} =
through
|> Enum.reverse()
|> Enum.reduce({fields, query, sub_preloads}, &{nil, nil, [{&1, &2}]})
|> elem(2)

expand(schema, through, query_assocs, {assocs, [{info, sub_preloads, false} | throughs], embeds})
end
Expand Down

0 comments on commit 64eb7dd

Please sign in to comment.