From 4a2563d5ae5bd29b8f90c6e5468fe87655054e87 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Wed, 15 Nov 2023 17:26:57 -0500 Subject: [PATCH] fix: set actor when computing aggregates that reference calculations --- lib/ash/data_layer/ets/ets.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ash/data_layer/ets/ets.ex b/lib/ash/data_layer/ets/ets.ex index 2f73636a..46be3bc6 100644 --- a/lib/ash/data_layer/ets/ets.ex +++ b/lib/ash/data_layer/ets/ets.ex @@ -606,11 +606,14 @@ defmodule Ash.DataLayer.Ets do name: name, load: load, uniq?: uniq?, + context: context, default_value: default_value }, {:ok, record} -> with {:ok, loaded_record} <- - api.load(record, relationship_path_to_load(relationship_path, field)), + api.load(record, relationship_path_to_load(relationship_path, field), + actor: Map.get(context, :actor) + ), related <- Ash.Filter.Runtime.get_related(loaded_record, relationship_path), {:ok, filtered} <-