fix: derived belongs_to attributes are required if their parent is

This commit is contained in:
Zach Daniel 2020-11-07 00:09:04 -05:00
parent a7c0b67318
commit 8fd26d66ca
No known key found for this signature in database
GPG key ID: C377365383138D4B

View file

@ -23,6 +23,7 @@ defmodule Ash.Resource.Transformers.BelongsToAttribute do
case Transformer.build_entity(@extension, [:attributes], :attribute,
name: relationship.source_field,
type: relationship.field_type,
allow_nil?: not relationship.required?,
writable?: false,
private?: true,
primary_key?: relationship.primary_key?