Skip to content

Commit

Permalink
use model_key for insert in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ottobar committed May 12, 2021
1 parent aefcce2 commit 2e08df2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paper_trail/multi.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule PaperTrail.Multi do
repo.insert(updated_changeset, ecto_options)
end)
|> Ecto.Multi.run(version_key, fn repo,
%{initial_version: initial_version, model: model} ->
%{:initial_version => initial_version, ^model_key => model} ->
target_version = make_version_struct(%{event: "insert"}, model, options) |> serialize()

Version.changeset(initial_version, target_version) |> repo.update
Expand Down

0 comments on commit 2e08df2

Please sign in to comment.