fix: persist a nil actor properly

This commit is contained in:
Zach Daniel 2022-08-09 21:32:32 -04:00
parent 7518168357
commit 3bcf731eea

View file

@ -24,8 +24,7 @@ defmodule Ash.Actions.Helpers do
private: %{ private: %{
actor: actor actor: actor
} }
} } ->
when not is_nil(actor) ->
Keyword.put_new(opts, :actor, actor) Keyword.put_new(opts, :actor, actor)
_ -> _ ->
@ -38,8 +37,7 @@ defmodule Ash.Actions.Helpers do
private: %{ private: %{
authorize?: authorize? authorize?: authorize?
} }
} } ->
when is_boolean(authorize?) ->
Keyword.put_new(opts, :authorize?, authorize?) Keyword.put_new(opts, :authorize?, authorize?)
_ -> _ ->
@ -105,7 +103,7 @@ defmodule Ash.Actions.Helpers do
opts opts
else else
case Process.get(:ash_authorize?) do case Process.get(:ash_authorize?) do
{:authorize?, value} when is_boolean(value) -> {:authorize?, value} ->
Keyword.put(opts, :authorize?, value) Keyword.put(opts, :authorize?, value)
_ -> _ ->