fix: don't use list inputs in belongs_to managed

This commit is contained in:
Zach Daniel 2021-08-03 00:00:37 -04:00
parent 6a189df2a0
commit a382a8ae20

View file

@ -71,10 +71,10 @@ defmodule Ash.Actions.ManagedRelationships do
current_value =
case Map.get(changeset.data, relationship.name) do
%Ash.NotLoaded{} ->
case relationship.cardinality do
:many -> []
:one -> nil
end
nil
other when is_list(other) ->
Enum.at(other, 0)
other ->
other