fix: invalid function arg parsing w/ ref

This commit is contained in:
Zach Daniel 2020-10-17 19:21:25 -04:00
parent 59063ff928
commit ad24164e2e
No known key found for this signature in database
GPG key ID: C377365383138D4B

View file

@ -31,6 +31,9 @@ defmodule Ash.Query.Function do
|> Enum.zip(configured_args) |> Enum.zip(configured_args)
|> Enum.with_index() |> Enum.with_index()
|> Enum.reduce_while({:ok, []}, fn |> 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) -> {{arg, :ref}, i}, {:ok, args} when is_atom(arg) ->
case Ash.Resource.attribute(ref.resource, arg) do case Ash.Resource.attribute(ref.resource, arg) do
nil -> nil ->