Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for creating such a great gem @lazebny. It's been really helpful. We have 2 main web apps. One is Rails and the other uses Cuba and Sequel. We added paper_trail to the first one but had no answers for the second. Your gem has made it possible for us to use paper_trail across both.
We encountered a problem when implementing this gem. Before,
SequelPaperTrail.whodunnit
andSequelPaperTrail.info_for_paper_trail
were global and shared among all threads. This is a problem in a web server that serves concurrent requests in separate threads:versions
table gets a new record with whodunnit of 'Amy' and NOT 'Paul'.Corrupted data! The regular paper_trail gem has a mechanism to bypass this. So I did a quick fix, where
SequelPaperTrail.whodunnit
andSequelPaperTrail.info_for_paper_trail
can also be a lambda or proc.This allowed us to define a lambda that uses the current request as a context for getting the value for the current user ID. No more corrupt data!
I hope you'll review and merge this PR and publish a new version. Thanks!