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

Thread-safe Audited.without_auditing #661

Open
dleavitt opened this issue Feb 20, 2023 · 1 comment
Open

Thread-safe Audited.without_auditing #661

dleavitt opened this issue Feb 20, 2023 · 1 comment

Comments

@dleavitt
Copy link

Currently there's no way to disable all auditing for a block, e.g.

Audited.without_auditing do
  # something that changes a lot of records
  record.deep_duplicate_with_all_associations
end

I'm guessing this is because it wouldn't be thread-safe. The per-class equivalent solves this by using a thread-local variable.

Would you be open to a PR that adds similar behavior to the global setting?

@Aesthetikx
Copy link

I would also like this, for example wrapping a long-running job that does not need auditing for the duration and context of that job.

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

No branches or pull requests

2 participants