From e012413a35f066e2d4faf482fd22be932b357bf5 Mon Sep 17 00:00:00 2001 From: Martin Frost Date: Wed, 10 Jun 2015 08:24:24 +0200 Subject: [PATCH] Explicitly `unquote(isn_type)` in Isn.Base This gets rid of `@isn_type` in Isn.Base. It was only ever there because I had to store it somewhere, since compile-time macro parameters are not available to a function at runtime. --- lib/isn.ex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/isn.ex b/lib/isn.ex index d1e3dbc..f8f9f8a 100644 --- a/lib/isn.ex +++ b/lib/isn.ex @@ -77,10 +77,10 @@ defmodule Isn.Base do |> String.replace(~r(.+\.), "") isn_type = ecto_type |> String.downcase + |> String.to_atom quote bind_quoted: [isn_type: isn_type, ecto_type: ecto_type] do @behaviour Ecto.Type - @isn_type isn_type @moduledoc """ Definition for the #{isn_type} module. @@ -97,8 +97,7 @@ defmodule Isn.Base do end """ - def type, - do: @isn_type + def type, do: unquote(isn_type) defdelegate blank?, to: Ecto.Type