Ruby on Rails 中模型的版本控制

发布于 2024-08-10 16:47:13 字数 350 浏览 8 评论 0原文

我正在寻找一个插件/行为来允许对我的模型进行版本控制。找到可用解决方案的列表有点困难。到目前为止,我收集了:

  • acts_as_versioned
  • simply_versioned
  • vestal_versions

最后两个解决方案只需要一个版本表 - 这听起来不错,但我有一个对于迁移的便利性将如何受到影响(因为它们将状态序列化为字符串)感到不好。

另一方面,acts_as_versioned 有点脏(最后一次提交是在一月份)。最近有这些方面的经历吗?或者我可能忽略的其他解决方案(或分叉)?

I'm looking for a plugin/act to allow versioning of my models. It's kind of difficult to find a list of the available solutions. So far I gathered:

  • acts_as_versioned
  • simply_versioned
  • vestal_versions

The last two solutions only require a single version table - this sounds nice, but I've got a bad feeling about how the ease of migrations will be affacted by this (because they serialize states as a string).

On the other hand, acts_as_versioned is a little bit dusty (last commit in January). Are there any recent experiences with any of these? Or other solutions (or forks) I might have overlooked?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

春风十里 2024-08-17 16:47:13

我一直在研究一种名为“paper_trail”的宝石。这似乎是目前网上最好的解决方案。它将审计和版本控制合二为一。

http://github.com/airblade/paper_trail

希望这有帮助!

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!

花期渐远 2024-08-17 16:47:13

我上周使用过 vestal_versions,是的,它是最先进的替代方案,至少在空间方面是这样:您只存储您真正需要的内容。这是一个活跃的项目,1.0 版本将是一个巨大的更新,包含许多新功能;只要看看 1.0 分支就知道我的意思了。

但在玩了一下之后,我发现了一个很大的缺陷:性能。每次你需要一个特定的版本时,你都必须遍历所有中间版本,重建你需要的版本。这也意味着您无法直接编辑或删除版本,因为它可能会扰乱修改,从而破坏链条。为此,您需要充分处理版本,而 vestal_versions 目前无法做到这一点。

这样,对于我遇到的问题,我最终得到了自己的版本控制解决方案。我需要性能以及快速删除和编辑版本的能力,因此我牺牲了存储空间并开发了类似于 act_as_versioned 的东西。

但是,如果您不需要这个并且不需要经常恢复,我强烈推荐 vestal_versions。它是一种先进、可靠且活跃的解决方案,背后有一位充满热情的开发人员。

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.

沒落の蓅哖 2024-08-17 16:47:13

我们在一个项目中使用acts_as_audited,取得了相当大的成功。

您可以在 http://github.com/collectiveidea/acts_as_audited/ 找到

(最后一次提交于十一月 :-) )

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 :-) )

梦境 2024-08-17 16:47:13

几个月前,我测试了几种解决方案,vestal_versions 是最有效的。
还有来自 Ryan Bates 的精彩截屏视频

如果您正在寻找其他替代方案,请查看 Ruby 工具箱列表

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.

弄潮 2024-08-17 16:47:13

另一个插件是 paper_trail。以下是今天发布的 Railscast 的链接:

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

他还提到了为什么他更喜欢 paper_trail 而不是 Vestal_versions

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

清引 2024-08-17 16:47:13

嘿,我想知道是否有人考虑过在后端使用 Perforce、GitHub 等而不是数据库作为支持版本控制的方式?所以我猜它本质上是基于文件的数据检索......

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文