vestal_versions
vestal_versions copied to clipboard
How to loop through versions?
I wasn't sure how to go about doing this, initialy I had some code to the effect of this:
foo.version.downto(1) do |version|
foo.revert_to(version)
puts foo.version
end
But I was wondering if there was a direct way of doing it? Doing it this way pollutes foo's scope, so if I wanted to use the most up-to-date foo after the loop finishes executing I have to reload it.