Child form is not automatically added when a `:union` type attribute has a `value` of `nil`
Im trying to create a Form using
Form.for_update
on a resource that has a :union
type attribute where the value is nil:
With this the form.forms
is empty. I would expect the forms to have a union
key because I need a form to edit the union.
Adding a form using AshPhoenix.Form.add_form(form, :union)
adds the form, but that doesnt have the correct type
set in the union, it takes the first type from the constraints it seems.2 Replies
Posting here to get initial thoughts on if this is something that should work or that I'm doing something wrong. If this looks like a bug I will create a reproduction repo/test
Added a comment to a commit which causes this issue:
https://github.com/ash-project/ash_phoenix/commit/1c4d9ebd90d0c084abaf7ee550bf26171c20dcdd#r165509109
Solution
Created a PR to resolve the issue
https://github.com/ash-project/ash_phoenix/pull/417