vestal_versions icon indicating copy to clipboard operation
vestal_versions copied to clipboard

How to loop through versions?

Open nozpheratu opened this issue 11 years ago • 0 comments

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.

nozpheratu avatar Jun 14 '13 21:06 nozpheratu