fix: optimize ash type loading

This commit is contained in:
Zach Daniel 2021-06-24 01:11:54 -04:00
parent 92b6b8d2f8
commit 114de0af4e

View file

@ -661,28 +661,22 @@ defmodule Ash.Type do
@impl true @impl true
def type do def type do
storage_type = @parent.storage_type() @parent.storage_type()
if Ash.Type.ash_type?(storage_type) do
Ash.Type.storage_type(@parent.storage_type())
else
storage_type
end
end end
@impl true @impl true
def cast(term) do def cast(term) do
@parent.cast_input(term, Ash.OptionsHelpers.validate!([], @parent.constraints())) @parent.cast_input(term, [])
end end
@impl true @impl true
def load(term) do def load(term) do
@parent.cast_stored(term, Ash.OptionsHelpers.validate!([], @parent.constraints())) @parent.cast_stored(term, [])
end end
@impl true @impl true
def dump(term) do def dump(term) do
@parent.dump_to_native(term, Ash.OptionsHelpers.validate!([], @parent.constraints())) @parent.dump_to_native(term, [])
end end
@impl true @impl true