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

User must exist error #1412

Closed
ramaboo opened this issue Dec 15, 2022 · 2 comments
Closed

User must exist error #1412

ramaboo opened this issue Dec 15, 2022 · 2 comments
Labels

Comments

@ramaboo
Copy link

ramaboo commented Dec 15, 2022

Paper trail 14 seems to break in ways I was not expecting in environments without users. Given a model

class Something
has_paper_trail
end

Doing something simple like Something.destroy in console results in a User must exist error. This means any changes to the Something model in console or Sidekiq fail even though Something.valid?. For destroy this will cause the original Something to be destroyed but none of its dependent relationships :( A far better way would be to set user to 0 or nil rather than just dying.

@BagpipesJohnson
Copy link

I think that's why it's recommended to set whodunnit for whoever is running the console: https://github.com/paper-trail-gem/paper_trail/wiki/Setting-whodunnit-in-the-rails-console

@github-actions
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 Mar 21, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
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