From 857c0079077155fae70885e6435ae4f426e1134d Mon Sep 17 00:00:00 2001 From: Benjamin Milde Date: Thu, 10 Sep 2020 17:13:13 +0200 Subject: [PATCH] Create the event struct correctly --- lib/fable/events.ex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/fable/events.ex b/lib/fable/events.ex index 0c9143a..98a6d5e 100644 --- a/lib/fable/events.ex +++ b/lib/fable/events.ex @@ -337,10 +337,9 @@ defmodule Fable.Events do } case config.event_schema do - {_table, schema} -> schema - schema -> schema + {table, schema} -> schema |> struct() |> Ecto.put_meta(source: table) + schema -> schema |> struct() end - |> struct() |> Ecto.Changeset.cast(attrs, Map.keys(attrs)) end