mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 21:43:02 +12:00
fix: optimize ash type loading
This commit is contained in:
parent
92b6b8d2f8
commit
114de0af4e
1 changed files with 4 additions and 10 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue