mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
fix: use create generators for embedded types
This commit is contained in:
parent
c4b2701d65
commit
6a5543e291
1 changed files with 8 additions and 3 deletions
|
@ -267,10 +267,15 @@ defmodule Ash.Type do
|
|||
|
||||
Code.ensure_compiled!(type)
|
||||
|
||||
if function_exported?(type, :generator, 1) do
|
||||
type.generator(constraints)
|
||||
if Ash.Type.embedded_type?(type) do
|
||||
action = constraints[:create_action] || Ash.Resource.Info.primary_action!(type, :create)
|
||||
Ash.Generator.action_input(type, action)
|
||||
else
|
||||
raise "generator/1 unimplemented for #{inspect(type)}"
|
||||
if function_exported?(type, :generator, 1) do
|
||||
type.generator(constraints)
|
||||
else
|
||||
raise "generator/1 unimplemented for #{inspect(type)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue