View timestamp_range.ex
defmodule MyApp.TimestampRange do
@behaviour Ecto.Type
def type, do: :tsrange
def cast([lower, upper]) do
{:ok, [lower, upper]}
end
def cast(_), do: :error