1

I have it set up right now to save Images to my rails filesystem and keep the old version of the file in a path like /images/:id/:version/:filename

How do I use vestal_versions to get the url of the old file path?

Using .revert_to!(1) increments the actual version number, so a @image.version of 2 which is then reverted to 1, becomes version 3, totally throwing a monkey wrench in my ability to get the url of the old file.

Using reset_to deletes all later revisions.

How do I do this? Do you need clarification?

maletor
  • 7,072
  • 7
  • 42
  • 63

1 Answers1

2

How about just using .revert_to(1) instead of revert_to!(1) ? That way it will not perform a database update unless you choose to save it.

DanneManne
  • 21,107
  • 5
  • 57
  • 58