From a8b137c1bbbd0308e6fb77dd1df8e21bb87a6c73 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Wed, 7 Jul 2021 16:31:31 -0400 Subject: [PATCH] fix: don't turn strings to atoms in `:atom` type --- lib/ash/type/atom.ex | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ash/type/atom.ex b/lib/ash/type/atom.ex index 8a213f17..3d055519 100644 --- a/lib/ash/type/atom.ex +++ b/lib/ash/type/atom.ex @@ -49,12 +49,7 @@ defmodule Ash.Type.Atom do {:ok, value} end - def cast_input(value, _) when is_binary(value) do - {:ok, String.to_existing_atom(value)} - rescue - ArgumentError -> - :error - end + def cast_input(_value, _), do: :error @impl true def cast_stored(value, _) when is_atom(value) do @@ -68,6 +63,8 @@ defmodule Ash.Type.Atom do :error end + def cast_stored(_, _), do: :error + @impl true def dump_to_native(value, _) when is_atom(value) do {:ok, to_string(value)}