Ash Paper Trail, changes

Hi, I am currently useing ash_paper_trail on a ressource that have an attribute define as :map. inside this map there is nested maps too. Despite the attribute ("accounting" in the following example) does not change, when I load my data from DB and get the last paper_trail_versions Example:
List.last(booking.paper_trail_versions) #=> %Marge.AshDomains.Reservations.Booking.Version{
actor: #Ash.NotLoaded<:relationship, field: :actor>,
version_source: #Ash.NotLoaded<:relationship, field: :version_source>,
__meta__: #Ecto.Schema.Metadata<:loaded, "bookings_versions">,
id: "a2a52dc5-989e-400e-8552-8f76201a934c",
version_action_type: :update,
version_action_name: :update,
version_action_inputs: %{
"notes" => "Guest want apple in the room and also pears and saucisson and bread and wine and beer and strawberries with champagne or sauterne and rasberries and bier (german's one or french one's) and chocolate and mousse and sauternes"
},
version_source_id: "74274c18-fbea-4a84-9500-66507f16326b",
changes: %{
"accounting" => %{
"camp" => %{
"detail" => [
...
...
...
"adult_count" => 2,
"child_count" => 0,
"discount_lodging" => "0.25",
"end_date" => "2025-08-05",
"notes" => "Guest want apple in the room and also pears and saucisson and bread and wine and beer and strawberries with champagne or sauterne and rasberries and bier (german's one or french one's) and chocolate and mousse and sauternes",
"start_date" => "2025-08-03",
"status" => "draft",
"tax_exempt" => true
},
version_inserted_at: ~U[2025-08-12 10:06:44.463563Z],
version_updated_at: ~U[2025-08-12 10:06:44.463563Z],
actor_id: nil
}
List.last(booking.paper_trail_versions) #=> %Marge.AshDomains.Reservations.Booking.Version{
actor: #Ash.NotLoaded<:relationship, field: :actor>,
version_source: #Ash.NotLoaded<:relationship, field: :version_source>,
__meta__: #Ecto.Schema.Metadata<:loaded, "bookings_versions">,
id: "a2a52dc5-989e-400e-8552-8f76201a934c",
version_action_type: :update,
version_action_name: :update,
version_action_inputs: %{
"notes" => "Guest want apple in the room and also pears and saucisson and bread and wine and beer and strawberries with champagne or sauterne and rasberries and bier (german's one or french one's) and chocolate and mousse and sauternes"
},
version_source_id: "74274c18-fbea-4a84-9500-66507f16326b",
changes: %{
"accounting" => %{
"camp" => %{
"detail" => [
...
...
...
"adult_count" => 2,
"child_count" => 0,
"discount_lodging" => "0.25",
"end_date" => "2025-08-05",
"notes" => "Guest want apple in the room and also pears and saucisson and bread and wine and beer and strawberries with champagne or sauterne and rasberries and bier (german's one or french one's) and chocolate and mousse and sauternes",
"start_date" => "2025-08-03",
"status" => "draft",
"tax_exempt" => true
},
version_inserted_at: ~U[2025-08-12 10:06:44.463563Z],
version_updated_at: ~U[2025-08-12 10:06:44.463563Z],
actor_id: nil
}
We can see that "changes" have many data such as "accounting", "adult_count" .... The thing that bothers me is that only "notes" have been modified. Why do I see the others too ? If you have an idea, please let me know. Regards, Angy
2 Replies
AngyL75
AngyL75OP2mo ago
Oh true, I did snapshot! I See. thanks.

Did you find this page helpful?