File tree Expand file tree Collapse file tree 1 file changed +26
-11
lines changed Expand file tree Collapse file tree 1 file changed +26
-11
lines changed Original file line number Diff line number Diff line change @@ -2495,18 +2495,33 @@ defmodule Ash.Actions.Read do
24952495 )
24962496
24972497 expr =
2498- Ash.Filter . move_to_relationship_path ( expr , relationship_path )
2498+ add_calc_context_to_filter (
2499+ expr ,
2500+ actor ,
2501+ authorize? ,
2502+ tenant ,
2503+ tracer ,
2504+ domain ,
2505+ ref . resource ,
2506+ opts
2507+ )
24992508
2500- add_calc_context_to_filter (
2501- expr ,
2502- actor ,
2503- authorize? ,
2504- tenant ,
2505- tracer ,
2506- domain ,
2507- ref . resource ,
2508- opts
2509- )
2509+ expanded_calc = % Ash.Query.Calculation {
2510+ name: calc . name ,
2511+ module: Ash.Resource.Calculation.Expression ,
2512+ opts: [ expr: expr ] ,
2513+ type: calc . type ,
2514+ constraints: calc . constraints ,
2515+ filterable?: calc . filterable? ,
2516+ sortable?: calc . sortable? ,
2517+ sensitive?: calc . sensitive? ,
2518+ load: calc . load ,
2519+ select: calc . select ,
2520+ context: calc . context
2521+ }
2522+
2523+ # Return a Ref at the relationship path with the expanded calculation
2524+ % { ref | attribute: expanded_calc , relationship_path: relationship_path }
25102525 else
25112526 % { ref | attribute: calc }
25122527 end
You can’t perform that action at this time.
0 commit comments