Closed jechol closed 3 months ago
I think for your specific example, there are two ways it could be approached.
we could alter spark to make AddEntity
allow adding entities to entities. argument
is a nested entity within the create
entity.
you could define a macro
defmacro opt(name, type, opts) do
quote do
attribute unquote(name), unquote(type), unquote(Keyword.put(opts, :allow_nil?, true))
end
end
I'm going to close this particular issue, because allowing extensions to overwrite entities by other extensions is a whole can of worms that we should avoid unless we have no other option :)
Is your feature request related to a problem? Please describe. When creating an entity to replace Ash's default entity, there is no way to remove the existing entity.
Describe the solution you'd like Add Spark.Dsl.Patch.ReplaceEntity, DeleteEntity
Express the feature either with a change to resource syntax, or with a change to the resource interface
Instead of code with existing entity from Ash like below,
I want to write like this in my application.
But there is no way to replace
create
entity with my customcreate
entity. I can only add a new entity but it makes callcreate
ambiguous.