fix: don't incur compile time dependency for resources used as types

This commit is contained in:
Zach Daniel 2022-11-15 10:03:34 -05:00
parent 43362c7656
commit e62d8e4a13

View file

@ -328,8 +328,12 @@ defmodule Ash.Type do
end end
def ecto_type(type) do def ecto_type(type) do
if Ash.Resource.Info.resource?(type) do
Module.concat(type, EctoType)
else
type.ecto_type() type.ecto_type()
end end
end
def ash_type_option(type) do def ash_type_option(type) do
type = get_type(type) type = get_type(type)