什么是存储的ActiveRecord模型的版本和它们与版本的最好方法是什么? [英] What's the best way to store the ActiveRecord Models with Versions and their Associations with Versions?

查看:201
本文介绍了什么是存储的ActiveRecord模型的版本和它们与版本的最好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我只有一个模型(比如维基),并要保存它以及它的版本,我可以用acts_as_versioned插件,它存储了维基在维基百科表及其在wikis_versions表版本。这是一个朴素简单的,即使我想用一个字段作为状态为待审核/发表显示它在公众面前,中度的最新版本。

If all I have is one model (for example Wiki) and want to save it along with its versions, I could use acts_as_versioned plugin which stores the wikis in "wikis" table and its versions in "wikis_versions" table. This is plain an simple even if I want to moderate the latest version before showing it to the public using a field as status with "pending review/ published".

什么是处理与维基协会的最佳方法(如附件,资产,...),这也有版本?而且你会如何适度呢?你创建一个新版本的维基尽管只有其相关联地改变只是为了保持流动去,如果是的话那其他关联?

What's the best way to handle Wiki with associations (for example attachments, assets,..) which also have versions? And how would you moderate it? Do you create a new version to wiki even though only its association is changed just to keep the flow going, if so what about other associations?

什么是与小分贝的开销来处理它的最佳方法?

What's the best way to handle it with little db overhead?

在此先感谢。

推荐答案

我都用了acts_as_versioned和acts_as_audited。

I have used both acts_as_versioned and acts_as_audited.

我preFER后者,因为它使用一个表。使用acts_as_versioned我们已经与修改版本表需要额外的迁移=>这增加了额外的复杂性,我们构建和部署过程的问题​​。

I prefer the latter because it uses a single table. Using acts_as_versioned we've had issues with changes to versioned tables requiring extra migrations => this adds extra complexity to our build and deployment process.

这篇关于什么是存储的ActiveRecord模型的版本和它们与版本的最好方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆