Versioning of Models in Ruby on Rails

為{幸葍}努か 提交于 2019-11-30 02:27:18

I've worked with vestal_versions last week and yes, it is the most advanced alternative, at least in terms of space: you store just what you really need. It is an active project and the version 1.0 is going to be a huge update with many new features; just look at the 1.0 branch to know what I mean.

But after playing with it a bit, I've noticed a big flaw: performance. Every time you need an specific version, you have to go through all intermediate ones, reconstructing the version you need. This also means you cannot edit or delete a version directly, because it can mess with modifications, broking the chain. For do this, you need to process versions adequately, what vestal_versions currently does not do.

This way, for the problem I had, I ended up with my own versioning solution. I needed performance and the ability to delete and edit versions rapidly, so I sacrificed storage and developed something similiar to act_as_versioned.

BUT, if you don't need this and do not have to revert very frequently, I highly recommend vestal_versions. It is an advanced, solid solution and an active one, with a passionate developer behind it.

Ive been working with a gem called "paper_trail". It seems to be the best solution online at the moment. It has auditing and version control in one.

http://github.com/airblade/paper_trail

Hope this helps!

We used acts_as_audited in a project, with quite a good success.

You can find that at http://github.com/collectiveidea/acts_as_audited/

(last commit in november :-) )

Simone Carletti

A couple of months ago I tested a couple of solutions and vestal_versions was the most effective. There's also a great screencast here from Ryan Bates.

If you are looking for other alternatives, check out The Ruby Toolbox list.

Another plugin is paper_trail. Here is a link to the railscasts posted today:

http://railscasts.com/episodes/255-undo-with-paper-trail

He also mentions why he prefers paper_trail over vestal_versions

Hey, I'm wondering if anyone has thought of using Perforce, GitHub, etc. on the backend INSTEAD of a database as a way to support versioning? So it would essentially be file-based retrieval of data, I guess...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!