Fix atom casting when empty string (#252)

This commit is contained in:
Darren Black 2021-07-08 14:24:05 +10:00 committed by GitHub
parent 678533a8cb
commit 57da53a7bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ defmodule Ash.Type.Atom do
{:ok, value}
end
def cast_input(_value, ""), do: nil
def cast_input("", _), do: nil
def cast_input(value, _) when is_binary(value) do
{:ok, String.to_existing_atom(value)}