[英]What's the best way to store the ActiveRecord Models with Versions and their Associations with 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. 如果我只有一个模型(例如Wiki),并且想要将其连同版本一起保存,则可以使用acts_as_versioned插件,该插件将wiki存储在“ wikis”表中,并将其版本存储在“ wikis_versions”表中。 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? 使用具有版本的关联(例如附件,资产等)处理Wiki的最佳方法是什么? 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?
您是否为Wiki创建了一个新版本,即使仅更改了它的关联只是为了保持流程的正常进行,如果这样,其他关联又如何呢?
What's the best way to handle it with little db overhead? 用很少的数据库开销来处理它的最佳方法是什么?
Thanks in advance. 提前致谢。
I have used both acts_as_versioned and acts_as_audited. 我已经使用了act_as_versioned和act_as_audited。
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.
使用acts_as_versioned,我们遇到了版本表更改方面的问题,需要额外的迁移=>这为我们的构建和部署过程增加了额外的复杂性。
Richard Livsey has a nice plugin for this that works with acts_as_versioned. 理查德·利夫西(Richard Livsey)为此提供了一个不错的插件,可与acts_as_versioned一起使用。
http://github.com/rlivsey/acts_as_versioned_association/tree/master http://github.com/rlivsey/acts_as_versioned_association/tree/master
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.