Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard Rails Gem for storing what User created/updated/deleted any Record?

What's the standard/best option out there for this kind of version control? The main thing I'm looking for is to track what user edited a record.

I've seen these so far and am wondering what your take is:

  • PaperTrail
  • ActsAsAudited
  • VestalVersions
like image 650
Lance Avatar asked Oct 25 '22 06:10

Lance


2 Answers

The plugins you mentioned all seem to take the same approach, and seem to be somewhat similar in approach: use a seperate table to store the old versions.

None of them seem to be really rails3-ready (looking at the generators), but PaperTrail reportedly should work with rails3, and has the most recent commit.

You could also look at the ruby-toolbox user-stamping and versioning. There you can see which project has the most "traction", which has the most recent commits. Which sometimes can help to make a choice between similar options.

like image 128
nathanvda Avatar answered Dec 10 '22 08:12

nathanvda


For stamping user_ids onto rows there is the the userstamp plugin

http://github.com/delynn/userstamp

EDIT:

Based on the requirement mentioned in your comment, I would recommend act_as_audited

http://github.com/collectiveidea/acts_as_audited

We are using it successfully for a very large application.

Peer

like image 20
Peer Allan Avatar answered Dec 10 '22 09:12

Peer Allan