--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/2fdcbff9-5551-4e91-aea1-68fc7447adfan%40googlegroups.com.
iex(2)> Ecto.Type.cast(:integer, 42)
{:ok, 42}
iex(3)> Ecto.Type.cast(:integer, "42")
{:ok, 42}defmodule MyApp do
def cast!(type, term) do
{:ok, casted} = Ecto.Type.cast(type, term)
casted
end
endTo view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J0rxCk7vK%3D1r%2BM9As7UV8n7JXHt0g4t%3DuMeLB2YVBFjw%40mail.gmail.com.