Acts_as_versionable and prospective versions

Anyone out there really familiar with acts_as_versionable ?

I’ve recently got it working, and I think it’s working great.

But what I want to do is a little different than what it does by

Currently, each time I save the activerecord, the plugin increments
the version number in the main table, and writes a copy to the table
that stores old versions.

What I’d like to be able to do is have prospective versions that are
not the current one, but are a higher version number than the one
stored in the main model table. Basically I am trying to add a system
where changes to records create a new version, and are merged and
approved before they become “active”.

I could build a separate system to hold the prospective versions (it
would be very similar to acts_as_versionable) - and then do the merge
and keep acts_as_versionable unchanged…

but it would be great if I could do this with the plugin now.

Anyone else done anything like this?


You might find this plugin,
acts_as_draftable, also from Rick O., helpful.

Benjamin C. – Collaborative test case management – Resources for the Rails community

On 7/11/06, Benjamin C. [email protected] wrote:

You might find this plugin,,
also from Rick O., helpful.

It would work, but each draft is only versioned once. If you do a lot
of edits before making your change live, it might be better to add
some simple #save_new_version method to acts as versioned. It would
create the new version, yet keep the record’s version the same. When
you’re ready to make a change live, then simply call revert_to.

@article.create(…) # version 1
@article.save_new_version # saved to version 2
@article.version # => 1
@article.revert_to! 2

If you can work up a little patch with unit tests, I’d be happy to
include this in acts as versioned. I’m guessing that 90% of it is
done anyway.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs