vestal_versions icon indicating copy to clipboard operation
vestal_versions copied to clipboard

Full history of a model

Open javierm opened this issue 15 years ago • 3 comments

The other day I was using vestal_versions, and I wanted to display a page with all the titles a post had had since its creation. So, I basically needed an array of post objects, each of them belonging to a revision.

I ended up writing this method in my model:

def revisions versions.collect do |version| revert_to(version) self.clone end end

Then I thought that it might be interesting to have it inside the plugin. So, in case you (or someone else) is interested, I share the idea.

Regards, and thanks for this very useful gem.

javierm avatar Nov 10 '09 20:11 javierm

Javier,

Great idea! I'll get that or something similar into 1.0. Thanks,

Steve

laserlemon avatar Nov 11 '09 15:11 laserlemon

Version 1.0 was just released. I'm still considering adding this functionality, but it hasn't been included in 1.0 just yet. Stay tuned!

laserlemon avatar Jan 03 '10 01:01 laserlemon

Hi, the code on top would not show the initial revision. My shot for complete history - http://gist.github.com/347049

vsalbaba avatar Mar 28 '10 21:03 vsalbaba