Fix perennial :atom issue
This commit is contained in:
@ -14,7 +14,7 @@ defmodule Outlook.Articles.InternalTree do
|
|||||||
def cast(_), do: :error
|
def cast(_), do: :error
|
||||||
|
|
||||||
def load(tree) when is_binary(tree) do
|
def load(tree) when is_binary(tree) do
|
||||||
{:ok, Jason.decode!(tree, keys: :atoms!) |> from_json}
|
{:ok, Jason.decode!(tree, keys: :atoms) |> from_json}
|
||||||
end
|
end
|
||||||
|
|
||||||
def dump(tree) when is_list(tree) do
|
def dump(tree) when is_list(tree) do
|
||||||
|
|||||||
@ -13,7 +13,7 @@ defmodule Outlook.Translations.TranslationUnitsMap do
|
|||||||
|
|
||||||
def load(serialized_map) when is_map(serialized_map) do
|
def load(serialized_map) when is_map(serialized_map) do
|
||||||
tumap = for {key, val_str} <- serialized_map do
|
tumap = for {key, val_str} <- serialized_map do
|
||||||
val_map = Jason.decode!(val_str, keys: :atoms!)
|
val_map = Jason.decode!(val_str, keys: :atoms)
|
||||||
val_tu = struct(TranslationUnit, %{val_map | status: String.to_atom(val_map.status)})
|
val_tu = struct(TranslationUnit, %{val_map | status: String.to_atom(val_map.status)})
|
||||||
{key, val_tu}
|
{key, val_tu}
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user