Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changeset shows no changes,but it's created #1430

Closed
Iiuqingshan opened this issue Jul 15, 2023 · 2 comments
Closed

changeset shows no changes,but it's created #1430

Iiuqingshan opened this issue Jul 15, 2023 · 2 comments
Labels

Comments

@Iiuqingshan
Copy link

I configured papertrail in the ApplicationRecord, and the model will inherit the ApplicationRecord
But when I save directly without updating any properties, the version is still created

has_paper_trail(
    # synchronize_version_creation_timestamp: false,
    on: [:update, :create, :destroy],
    ignore: [:updated_at],
    versions: { class_name: "MfaVersion" })

The changeset in the final generated version looks like this

object_changes: {"announcement"=>[{}, {}]},
@iltempo
Copy link

iltempo commented Sep 25, 2023

Regardless of the configuration, I ran into the same issue when a record was touched. If not explicitly, it might happen, for example, when a touch: true relationship between models is defined.

The workaround for me was to install the callbacks manually. https://github.com/paper-trail-gem/paper_trail#controlling-the-order-of-ar-callbacks

Copy link

This issue has been automatically marked as stale due to inactivity.
The resources of our volunteers are limited.
Bug reports must provide a script that reproduces the bug, using our template. Feature suggestions must include a promise to build the feature yourself.
Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Dec 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants