From 8106093229ca92fffb5f75b20f026361d005bbb0 Mon Sep 17 00:00:00 2001 From: Martin Frost Date: Tue, 10 May 2022 20:34:13 +0200 Subject: [PATCH] Use Ecto.Type instead of `@behaviour Ecto.Type` --- lib/isn.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/isn.ex b/lib/isn.ex index ba6c4c0..5a6390f 100644 --- a/lib/isn.ex +++ b/lib/isn.ex @@ -79,8 +79,6 @@ for module <- ~w(ISBN ISMN ISSN ISBN13 ISMN13 ISSN13 UPC EAN13) do ecto_type = module |> String.downcase() |> String.to_atom() defmodule module_name do - @behaviour Ecto.Type - @moduledoc """ Definition for the ISN.#{module} module. @@ -96,6 +94,8 @@ for module <- ~w(ISBN ISMN ISSN ISBN13 ISMN13 ISSN13 UPC EAN13) do end """ + use Ecto.Type + def type, do: unquote(ecto_type) def cast(nil), do: :error