Created
September 28, 2020 17:41
-
-
Save alexgaribay/9470243c7995a171c199a24fde80e461 to your computer and use it in GitHub Desktop.
Enum suggestion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
types = %{ | |
my_enum: {:parameterized, Ecto.Enum, values: [:a, :b, :c]} | |
} | |
# https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/type.ex#L771 | |
defp cast_fun({:parameterized, mod, init_params}), do: &mod.cast(&1, mod.init(init_params)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment