Skip to content

Commit

Permalink
fix dialyzer warnings (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
superhawk610 authored Apr 20, 2021
1 parent 5ca99ef commit c937269
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/paper_trail.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/version.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit c937269

Please sign in to comment.