mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
fix: add __source__ to union inner_constraints (#1160)
This commit is contained in:
parent
3e27ca9df5
commit
de0bd815e8
1 changed files with 8 additions and 1 deletions
|
@ -365,7 +365,14 @@ defmodule Ash.Type.Union do
|
||||||
|
|
||||||
inner_constraints =
|
inner_constraints =
|
||||||
if Ash.Type.embedded_type?(type) do
|
if Ash.Type.embedded_type?(type) do
|
||||||
Keyword.put(inner_constraints, :__union_tag__, constraints[:types][type_name][:tag])
|
case constraints[:__source__] do
|
||||||
|
%Ash.Changeset{} = source ->
|
||||||
|
Keyword.put(inner_constraints, :__source__, source)
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
inner_constraints
|
||||||
|
end
|
||||||
|
|> Keyword.put(:__union_tag__, constraints[:types][type_name][:tag])
|
||||||
else
|
else
|
||||||
inner_constraints
|
inner_constraints
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue