You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no relationship called :changeset in paper_trail. PaperTrail.insert , update and delete functions wrap your record insertion/edit in a database transaction and creates a row with associated data in the versions table. You shouldnt change the data manually like this.
@izelnakri We're struggling with the same issue. Joshua is not updating the data manually; he is using Ecto's put_assoc to populate a changeset. Papertrail does operate on changesets created with cast. If associations are not supported that is fine I guess but is this something you'd be open to a PR addressing (if its feasible) ?
So I'm doing something like
Now, when saving, it gives me the following error:
** (Poison.EncodeError) unable to encode value: {:assoc, %Ecto.Association.BelongsTo{cardinality: :one, defaults: [], field: :something, on_cast: nil, on_replace: :raise, owner: MyApp.Something, owner_key: :something_id, queryable: MyApp.Something, related: MyApp.Something, related_key: :id, relationship: :parent, unique: true}}
I've tried setting a custom encoder for my model/schema in my app with poison, but it doesn't seem to work for paper_trail.
What's the best way to handle this?
The text was updated successfully, but these errors were encountered: