Closed yujonglee closed 2 months ago
@yujonglee could you provide a test that reproduces this?
Or a reproduction project?
@zachdaniel
Sure. Here's minimal repro project repo:
mix test
should surface problem with failing test.
Fixed in ash
main
. We've fixed this by honoring _union_type
in ash core.
Describe the bug Union type is not correctly inferred from
_union_type
when submitting form. This only happens if there's two embedded resource with same fields.For example, when this form is submitted,
Created record's config field is
%Ash.Union{type: :github_issue}
, not%Ash.Union{type: :github_discussion}
.To Reproduce
If I change
repo
field inGithubDiscussion.Config
torepo2
,%Ash.Union{type: :github_discussion}
is created. So it only fails to find the correct resource when there's multiple resources with same fields.I expected resource to be chosen based on
_union_type
.Runtime
3.4.7