Description
- I am committed to building this feature myself
- I will respond to feedback, and build this feature, in a reasonable amount
of time
Is your feature suggestion related to a problem? Please describe.
Getting the original version of an item is way too difficult. It stems from the fact that calling reify
on the first version
returns nil
and not the original object. That's fine. But it means that you need to do some fancy footwork to get the original version of an object and also handle when an object doesn't have any changes (i.e. only a single create
version).
You can see the issue in these two spots:
Describe the solution you'd like to build
I want to add an original_version
method to the has_paper_trail
concern that will return the original version of an object, regardless of how many changes the object has.
So instead of writing something like this versions.second&.reify || self
you can just write original_version
.
Describe alternatives you've considered
versions.second&.reify || self
Commit on Our Fork.
We're using 3.0-stable
branch so I forked that and committed our desired change there. No tests but we can certainly write them if you want this merged into master.