From ad24164e2ea38d11bffd0feca6f674dca77b53e4 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Sat, 17 Oct 2020 19:21:25 -0400 Subject: [PATCH] fix: invalid function arg parsing w/ ref --- lib/ash/query/function/function.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ash/query/function/function.ex b/lib/ash/query/function/function.ex index f207c53e..0ef887a0 100644 --- a/lib/ash/query/function/function.ex +++ b/lib/ash/query/function/function.ex @@ -31,6 +31,9 @@ defmodule Ash.Query.Function do |> Enum.zip(configured_args) |> Enum.with_index() |> Enum.reduce_while({:ok, []}, fn + {{%Ash.Query.Ref{} = ref, :ref}, _i}, {:ok, args} -> + {:cont, {:ok, [ref | args]}} + {{arg, :ref}, i}, {:ok, args} when is_atom(arg) -> case Ash.Resource.attribute(ref.resource, arg) do nil ->