fix: build aggregate paths properly

This commit is contained in:
Zach Daniel 2021-07-05 14:25:04 -04:00
parent 5d0719cc71
commit 65113a075f

View file

@ -144,7 +144,7 @@ defmodule Ash.Query.Aggregate do
path_for_checking = path_for_checking =
relationship_path relationship_path
|> tl() |> tl()
|> Enum.reduce({[], aggregate_resource}, fn rel, {path, resource} -> |> Enum.reduce({[], relationship.destination}, fn rel, {path, resource} ->
relationship = Ash.Resource.Info.relationship(resource, rel) relationship = Ash.Resource.Info.relationship(resource, rel)
{[relationship | path], relationship.destination} {[relationship | path], relationship.destination}
end) end)