fix: unbound variable in schema definition

This commit is contained in:
Zach Daniel 2023-05-02 20:11:31 -04:00
parent e05b5058dc
commit 80820a01fc

View file

@ -69,11 +69,12 @@ defmodule Ash.Schema do
for aggregate <- Ash.Resource.Info.aggregates(__MODULE__), for aggregate <- Ash.Resource.Info.aggregates(__MODULE__),
aggregate.name not in Ash.Resource.reserved_names() do aggregate.name not in Ash.Resource.reserved_names() do
if aggregate.kind == :custom do {:ok, type} =
{:ok, aggregate.type} if aggregate.kind == :custom do
else {:ok, aggregate.type}
Aggregate.kind_to_type(aggregate.kind, :string) else
end Aggregate.kind_to_type(aggregate.kind, :string)
end
field(aggregate.name, Ash.Type.ecto_type(type), virtual: true) field(aggregate.name, Ash.Type.ecto_type(type), virtual: true)