-
Notifications
You must be signed in to change notification settings - Fork 39
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
has_many association versioning only ever returns the most recent version #4
Comments
Can you please clarify this bug report. Please provide clear and explained description of the problems you are experiencing and what conditions cause it. |
The sample code shows the issue. To try some psuedo-code rather than actual code:
Essentially: Versions only ever point to the most recent association assigned to the object in "has_many" cases and loses any association version history. (It also returns nothing with "has_many through" cases that the documentation claims should work... or I might be misreading what object history this gem supports in these cases). |
If you'd like to take a stab at this a PR would be greatly appreciated. If not it would really help if you could attempt add it to/edit the Known Issue list in the README that would be great. By the way, for the bug report template (or tests in general) you are supposed to use the built-in minitest assertions to compare actual and expected and not use puts. Sorry, I love puts debugging but this is not the right tool for this job. |
Originally filed at: paper-trail-gem/paper_trail#1095
This may be intentional despite the docs indicating otherwise but Association Versioning only ever returns the most recent version. I'll fill out the template but I've created a sample test case that shows two ways of such updates against the latest Master branch (I've spent hours trying dozens of ways):
Github: https://github.com/scande3/ptrail
Code: https://github.com/scande3/ptrail/blob/master/db/seeds.rb
Output of that will be:
Attempt at the bug report template that worked for me (albeit the output is harder to read with all the debug output):
The text was updated successfully, but these errors were encountered: