fix: don't use || when fetching arguments because false || nil is nil

fixes #722
This commit is contained in:
Zach Daniel 2023-10-03 16:30:23 -04:00
parent 1042ea14fd
commit 3d72e190b2

View file

@ -573,7 +573,13 @@ defmodule Ash.Filter do
get_path(actor || %{}, path)
{:_arg, field} ->
Map.get(args, field) || Map.get(args, to_string(field))
case Map.fetch(args, field) do
:error ->
Map.get(args, to_string(field))
{:ok, value} ->
value
end
{:_context, fields} when is_list(fields) ->
get_path(context, fields)