From 0262ae612d45149f5a670b6163503eba121366aa Mon Sep 17 00:00:00 2001 From: Eugene Pirogov <207112+gmile@users.noreply.github.com> Date: Thu, 15 Nov 2018 17:37:40 +0200 Subject: [PATCH] Incorporate fix from @alco Original commit https://github.com/alco/eview/commit/79538183a8cd495e80b75f1e3dc1289bd958eea3 --- lib/eview/helpers/changeset_validations_parser.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eview/helpers/changeset_validations_parser.ex b/lib/eview/helpers/changeset_validations_parser.ex index 752134d..8000040 100644 --- a/lib/eview/helpers/changeset_validations_parser.ex +++ b/lib/eview/helpers/changeset_validations_parser.ex @@ -63,6 +63,9 @@ if Code.ensure_loaded?(Ecto) do {key, {:array, :map}}, acc -> String.replace(acc, "%{#{key}}", "map") + {key, {:array, atom}}, acc when is_atom(atom) -> + String.replace(acc, "%{#{key}}", atom |> Atom.to_string() |> String.split(".") |> List.last() |> String.downcase()) + {key, {:array, Ecto.UUID}}, acc -> String.replace(acc, "%{#{key}}", "uuid")