Skip to content

Commit

Permalink
improvement: "full_diff tracking not atomic" error message (#123)
Browse files Browse the repository at this point in the history
* improvement: "full_diff tracking not atomic" error message

* Update lib/resource/changes/create_new_version.ex

---------

Co-authored-by: Zach Daniel <[email protected]>
  • Loading branch information
serpent213 and zachdaniel authored Oct 11, 2024
1 parent 4acc03b commit daf271b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/resource/changes/create_new_version.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ defmodule AshPaperTrail.Resource.Changes.CreateNewVersion do
change_tracking_mode = AshPaperTrail.Resource.Info.change_tracking_mode(changeset.resource)

if change_tracking_mode == :full_diff do
{:not_atomic, "Cannot perform full_diff change tracking with AshPaperTrail atomically."}
{:not_atomic, "Cannot perform full_diff change tracking with AshPaperTrail atomically. " <>
"You might want to choose a different tracking mode or set require_atomic? to false on your update actions."}
else
{:ok, change(changeset, opts, context)}
end
Expand Down

0 comments on commit daf271b

Please sign in to comment.