Reputation: 125
I'm working on switching from vestal_version to paper_trail.
I know vestal versions use versions number while paper_trails use timestamps.
paper_trails
has a method called version_at(timestamp)
, but I found a lot of versions in my table with the same exact date so that method will not work as expected.
I need to achieve the following.
widget1 = widget.paper_trail.version(4)
widget2 = widget.paper_trail.version(10)
# there are a couple of way to get the diff
# using active record diff ( I prefer this to Jeremy Weiskotten's PaperTrail)
changes = widget1.diff(widget2)
# I know I can do
versions = widget.versions[4]
# that only returns versions model instead of widget
Thanks for the help
Upvotes: 0
Views: 472