fix: ensure aggregate context is fully fleshed out in Ash.aggregate

closes #1277
This commit is contained in:
Zach Daniel 2024-07-03 12:34:58 -04:00
parent a06b161591
commit 00405aeb9e

View file

@ -161,6 +161,23 @@ defmodule Ash.Actions.Aggregate do
{:halt, {:error, error}}
end
end)
|> case do
{:ok, aggregates} ->
{:ok,
Enum.map(aggregates, fn aggregate ->
Ash.Actions.Read.add_calc_context(
aggregate,
opts[:actor],
opts[:authorize?],
opts[:tenant],
opts[:tracer],
query.domain
)
end)}
other ->
other
end
end
defp set_opts(query, specified, others) do