profile
viewpoint

Ask questionsUpdate `Ecto.Changeset.traverse_errors/2` example.

https://github.com/elixir-ecto/ecto/blob/e9dead98b1fe2f20358faee48b7fe00f17a71bc2/lib/ecto/changeset.ex#L2923-L2924

The DataCase.errors_on/1 function provided to a newly generated phoenix_ecto project used something similar to the existing example, but some changeset errors (maybe most commonly unsafe_validate_unique/4) would cause (ArgumentError) cannot convert the given list to a string. The relevant discussion is under: phoenixframework/phoenix#3204.

These lines should maybe instead be something like:

       ...>   Regex.replace(~r"%{(\w+)}", msg, fn _, key ->
       ...>     opts |> Keyword.get(String.to_existing_atom(key), key) |> to_string()
elixir-ecto/ecto

Answer questions jbcaprell

Addressed by #3683.

useful!
source:https://uonfu.com/
Github User Rank List