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

feat: Trigger an after_commit callback when restoring a record #559

Open
wants to merge 3 commits into
base: core
Choose a base branch
from

Conversation

yoheimuta
Copy link

Fixes #457

This PR adds a new option called after_restore_commit so that Paranoia triggers a callback after committing to restore a record. The default value is false, so this change won't affect existing users.

Currently, there is no way to trigger a callback after commit. The suggested workaround doesn't work since the restore method doesn't trigger after_commit, on: :update either.

📝 This branch is checked out from #558 to pass the CI tests.

@yoheimuta
Copy link
Author

@radar @mathieujobin Hi, I just wanted to see, is something wrong with this PR?

@mathieujobin
Copy link
Collaborator

@yoheimuta thanks for the reminder. I will review.

For now, can you update or rebase and fix the merge conflict please?

@yoheimuta
Copy link
Author

@mathieujobin Thank you for the reply.
I just fixed the merge conflict.

Copy link
Collaborator

@mathieujobin mathieujobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great feature with no downside.

All tests passed except for rails edge (8.0) and it's unlikely related

So I have no objections merging this

I will wait a bit for others to chime in and release later this month

@radar
Copy link
Collaborator

radar commented Sep 3, 2024

Looks good to me as well. Happy for you to handle the release when you're ready @mathieujobin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After Restore callback executing before commit
3 participants