1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.EctoType.Config.Atom do
10 def cast(key) when is_atom(key) do
14 def cast(key) when is_binary(key) do
15 {:ok, Pleroma.ConfigDB.string_to_elixir_types(key)}
18 def cast(_), do: :error
21 {:ok, Pleroma.ConfigDB.string_to_elixir_types(key)}
24 def dump(key) when is_atom(key), do: {:ok, inspect(key)}
25 def dump(_), do: :error