fix: correctly handle errors in validate_required_belongs_to (#276)

This commit is contained in:
kernel-io 2021-10-29 10:38:14 +13:00 committed by GitHub
parent 9613ab812c
commit 4113595f69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -272,6 +272,8 @@ defmodule Ash.Actions.ManagedRelationships do
end
end
defp validate_required_belongs_to({:error, error}), do: {:error, error}
defp validate_required_belongs_to({changeset, instructions}) do
changeset.resource
|> Ash.Resource.Info.relationships()