fix: proper source path for lateral joined relationships

This commit is contained in:
Zach Daniel 2023-04-30 22:45:54 -04:00
parent d7aaec7499
commit 7f460009af

View file

@ -942,7 +942,8 @@ defmodule Ash.Actions.Load do
end
data_path =
if relationship.type == :many_to_many do
if relationship.type == :many_to_many &&
!lateral_join?(source_query, relationship, :unknown) do
join_relationship = join_relationship(relationship)
join_relationship_path(path, join_relationship) |> Enum.map(& &1.name)