mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
fix: cast nil -> {:ok, nil} in all cases
This commit is contained in:
parent
0fbf7eab6a
commit
f895f3ddd8
2 changed files with 2 additions and 1 deletions
|
@ -159,7 +159,6 @@ defmodule Ash.EmbeddableType do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def cast_input(nil, _), do: {:ok, nil}
|
|
||||||
def cast_input(_, _), do: :error
|
def cast_input(_, _), do: :error
|
||||||
|
|
||||||
def cast_stored(value, constraints) when is_map(value) do
|
def cast_stored(value, constraints) when is_map(value) do
|
||||||
|
|
|
@ -345,6 +345,8 @@ defmodule Ash.Type do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cast_input(_, nil, _), do: {:ok, nil}
|
||||||
|
|
||||||
def cast_input(type, term, constraints) do
|
def cast_input(type, term, constraints) do
|
||||||
constraints = Ash.OptionsHelpers.validate!(constraints, constraints(type))
|
constraints = Ash.OptionsHelpers.validate!(constraints, constraints(type))
|
||||||
type = get_type(type)
|
type = get_type(type)
|
||||||
|
|
Loading…
Reference in a new issue