views:

338

answers:

2

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?

Thanks in advance.

A: 

Richard Livsey has a nice plugin for this that works with acts_as_versioned.

http://github.com/rlivsey/acts_as_versioned_association/tree/master

wmoxam
I looked at acts_as_versioned_association which actually depends on acts_as_versioned. Also acts_as_versioned_association is not ported to rails 2.3.2 and is failing as acts_as_versioned has already ported to rails 2.3.2 which is not compatible for acts_as_versioned_association anymore. Thanks for the feedback.
satynos
+1  A: 

I have used both acts_as_versioned and acts_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.

Toby Hede
@Toby:I looked into the acts_as_audited, did you have to moderate the revisions before showing it to the public, if so how did you handle the moderation? As far as I can see, acts_as_audited immediately changes the main table and stores the changes in the audited table. What I want is a way to keep the original record intact until the changes are being moderated and only change the original record when the moderator at the back end approves the changes. Did you happen to use such a kind of system?
satynos
You could probably adapt one of these plugins to meet your requirements. You would need to change when the version is recorded. We do post-moderation, so the version is tracked, but the moderator can revert or edit as appropriate.
Toby Hede
You said that you are using acts_as_audited, and also mentioned that you moderate where a moderator can revert or edit as appropriate. While studying the code, I don't see any revert option available. Did you happen to customize the acts_as_audited per your need? If so, would you post the bit that deals with moderation? Thanks in advance.
satynos
I just meant, because you have the previous version, you can simply go back to that one as appropriate. Will try and track down some code.
Toby Hede