-
Notifications
You must be signed in to change notification settings - Fork 903
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
Tracking many_to_many relationships #12
Comments
Yes and no. Although I don't think that's quite what you're after. The question is can we do:
-- and get the associated records back as they were at the time. The problem has two axes: the three types of relation on one and the three states of the associated record on the other (record is same entity with/without updates; record didn't exist at the time but was subsequently created; record did exist at the time but was subsequently deleted). It's easy where the associated record was the same entity or didn't exist then. Having said that, PaperTrail could do more of the work for you. It's trickier where the associated record has been subsequently deleted, particularly for has one and has many. All the information is there in the I'm therefore thinking about having another table to record assocations when they are destroyed. I'm about to go on holiday so it might be a while, but I hope to report a solution to this at some point. |
What about integrating something like http://github.com/winton/acts_as_archive/blob/master/lib/acts_as_archive/base/destroy.rb It would be awesome if PaperTrail could handle all delete cases, it does everything else great! |
Thanks for the idea. I'll take a look. |
@airblade: in a recent blog post, you mention perhaps making PaperTrail aware of requests or transactions, similar to Efficiency's TransactionID middleware. Were you thinking about generating a UUID for each transaction, making that available in the request's environment variable, then storing the transaction ID in the PaperTrail table if stuff is changed? This way, associations could be identified as records having the same transaction ID, and could therefore be reified? If so, I might end up taking a crack at this in the near future for a Rails app I'm developing... |
@ScrapCoder: that's exactly what I was thinking. Good luck! |
Closed in favor of PR #439, which was just merged. |
Is there any way to track many_to_many relationships with papertrail? (in this case track deletes and inserts on the relationship table)
The text was updated successfully, but these errors were encountered: