Mosselman
Mosselman

Reputation: 1748

How do I store versions of model data in rails?

I want to implement a way to version models in a ruby on rails app. (version 3.1+). What I am after is much like what mediawiki does; making it easy to diff the changes made, showing what changed and who changed it. Also, I would like to be able to store associated models (imagine comments on a blogpost). However, this last feature is a should-have, not a dealbreaker.

I should also be able to revert to older version of the model's data, not losing the versions that came after it.

I already ran into PaperTrail: https://github.com/airblade/paper_trail

Are there (better) alternatives? I am also not sure if paper trail allows for diffs.

Upvotes: 2

Views: 2252

Answers (1)

topek
topek

Reputation: 18979

Why not take a look at the Ruby Toolbox / Versioning

In my opinion the only options are:

  • Paper Trail
  • Vestal versions

all other are rather inactive.

As for diffing: Paper Trail can definitely do diffing of versions see https://github.com/airblade/paper_trail and look for 'Diffing Versions'

Upvotes: 6

Related Questions