X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=priv%2Frepo%2Fmigrations%2F20200716195806_autolinker_to_linkify.exs;h=570acba8404ca9b5f4b8947ccd01165053284068;hb=3aa25b008d145bc7bfda907bca3b327753380728;hp=9ec4203eb97dd543a1443b459dbb5cfcbd88f52a;hpb=5b1eeb06d81872696fac89dba457fe62b62d6182;p=akkoma diff --git a/priv/repo/migrations/20200716195806_autolinker_to_linkify.exs b/priv/repo/migrations/20200716195806_autolinker_to_linkify.exs index 9ec4203eb..570acba84 100644 --- a/priv/repo/migrations/20200716195806_autolinker_to_linkify.exs +++ b/priv/repo/migrations/20200716195806_autolinker_to_linkify.exs @@ -1,7 +1,5 @@ defmodule Pleroma.Repo.Migrations.AutolinkerToLinkify do use Ecto.Migration - - alias Pleroma.Repo alias Pleroma.ConfigDB @autolinker_path %{group: :auto_linker, key: :opts} @@ -23,15 +21,16 @@ defmodule Pleroma.Repo.Migrations.AutolinkerToLinkify do defp maybe_get_params() do with %ConfigDB{value: opts} <- ConfigDB.get_by_params(@autolinker_path), - %{} = opts <- transform_opts(opts), + opts <- transform_opts(opts), %{} = linkify_params <- Map.put(@linkify_path, :value, opts) do {:ok, {@autolinker_path, linkify_params}} end end - defp transform_opts(opts) when is_list(opts) do + def transform_opts(opts) when is_list(opts) do opts |> Enum.into(%{}) |> Map.take(@compat_opts) + |> Map.to_list() end end