Auto forms silently drops some associations
I ran into this while trying to use auto forms, grabbing values from the created
Got me wondering a few things. First, maybe I screwed up somewhere before
. Secondly for fixing it if it is a bug, it doesn't seem like we can know :single or :list beforehand , so would we need to use an anonymous function to resolve which similar to how data is resolved?
Alternatively, is it possible to just make them all
_join form. There were no errors, but not all of the resource associations were present. Looks like here https://github.com/ash-project/ash_phoenix/blob/main/lib/ash_phoenix/form/auto.ex#L469 we use Enum.find, so we are only getting the first occurence of the association. I tried editing it to Enum.filterand changing the type from :single to :list. This made the associations properly appear in the form, but submitting it failed. Got me wondering a few things. First, maybe I screwed up somewhere before
Alternatively, is it possible to just make them all
:list and handle the length = 1 case for single?GitHub
https://hexdocs.pm/ash_phoenix. Contribute to ash-project/ash_phoenix development by creating an account on GitHub.
