mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
fix: cast empty string to nil in atom
This commit is contained in:
parent
e2cd33fac3
commit
c9a19a7c2c
1 changed files with 2 additions and 0 deletions
|
@ -49,6 +49,8 @@ defmodule Ash.Type.Atom do
|
||||||
{:ok, value}
|
{:ok, value}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cast_input(value, ""), do: nil
|
||||||
|
|
||||||
def cast_input(value, _) when is_binary(value) do
|
def cast_input(value, _) when is_binary(value) do
|
||||||
{:ok, String.to_existing_atom(value)}
|
{:ok, String.to_existing_atom(value)}
|
||||||
rescue
|
rescue
|
||||||
|
|
Loading…
Reference in a new issue