Revert "chore: fix compiling embedded types (why??)"

This reverts commit d7ef5efbb2.
This commit is contained in:
Zach Daniel 2021-06-24 18:19:46 -04:00
parent 28a4429b9e
commit 21e52bebbd

View file

@ -22,8 +22,6 @@ defmodule Ash.Schema do
for attribute <- Ash.Resource.Info.attributes(__MODULE__) do
read_after_writes? = attribute.generated? and is_nil(attribute.default)
Ash.Schema.require_type(attribute.type)
field(attribute.name, attribute.type,
primary_key: attribute.primary_key?,
read_after_writes: read_after_writes?,
@ -37,7 +35,6 @@ defmodule Ash.Schema do
for aggregate <- Ash.Resource.Info.aggregates(__MODULE__) do
{:ok, type} = Aggregate.kind_to_type(aggregate.kind, :string)
Ash.Schema.require_type(type)
field(aggregate.name, type, virtual: true)
@ -52,7 +49,6 @@ defmodule Ash.Schema do
for calculation <- Ash.Resource.Info.calculations(__MODULE__) do
{mod, _} = calculation.calculation
Ash.Schema.require_type(calculation.type)
field(calculation.name, calculation.type, virtual: true)
@ -81,8 +77,6 @@ defmodule Ash.Schema do
for attribute <- Ash.Resource.Info.attributes(__MODULE__) do
read_after_writes? = attribute.generated? and is_nil(attribute.default)
Ash.Schema.require_type(attribute.type)
field(attribute.name, attribute.type,
primary_key: attribute.primary_key?,
read_after_writes: read_after_writes?,
@ -97,7 +91,6 @@ defmodule Ash.Schema do
for aggregate <- Ash.Resource.Info.aggregates(__MODULE__) do
{:ok, type} = Aggregate.kind_to_type(aggregate.kind, :string)
Ash.Schema.require_type(type)
field(aggregate.name, type, virtual: true)
struct_fields = Keyword.delete(@struct_fields, aggregate.name)
@ -112,7 +105,6 @@ defmodule Ash.Schema do
for calculation <- Ash.Resource.Info.calculations(__MODULE__) do
{mod, _} = calculation.calculation
Ash.Schema.require_type(calculation.type)
field(calculation.name, calculation.type, virtual: true)
struct_fields = Keyword.delete(@struct_fields, calculation.name)
@ -127,7 +119,4 @@ defmodule Ash.Schema do
end
end
end
def require_type({:array, type}), do: require_type(type)
def require_type(type), do: type.type()
end