diff --git a/lib/paper_trail.ex b/lib/paper_trail.ex index 41b99e37..b578b8d6 100644 --- a/lib/paper_trail.ex +++ b/lib/paper_trail.ex @@ -114,7 +114,10 @@ defmodule PaperTrail do |> model_or_error(:delete) end - @spec model_or_error(result :: {:ok, %{model: model}}, action :: :insert | :update | :delete) :: + @spec model_or_error( + result :: {:ok, %{required(:model) => model, optional(any()) => any()}}, + action :: :insert | :update | :delete + ) :: model when model: struct() defp model_or_error({:ok, %{model: model}}, _action) do diff --git a/lib/version.ex b/lib/version.ex index b10e9c1d..0f18aacc 100644 --- a/lib/version.ex +++ b/lib/version.ex @@ -41,7 +41,7 @@ defmodule PaperTrail.Version do ) end - def changeset(model, params \\ :empty) do + def changeset(model, params \\ %{}) do model |> cast(params, [:item_type, :item_id, :item_changes, :origin, :originator_id, :meta]) |> validate_required([:event, :item_type, :item_id, :item_changes])