mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
fix: ensure aggregate context is fully fleshed out in Ash.aggregate
closes #1277
This commit is contained in:
parent
a06b161591
commit
00405aeb9e
1 changed files with 17 additions and 0 deletions
|
@ -161,6 +161,23 @@ defmodule Ash.Actions.Aggregate do
|
||||||
{:halt, {:error, error}}
|
{:halt, {:error, error}}
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
defp set_opts(query, specified, others) do
|
defp set_opts(query, specified, others) do
|
||||||
|
|
Loading…
Reference in a new issue