What is the best way to maintain a record's edit history with Rails and ActiveRecord -


What is the best / clean / easy way to maintain the history of records in the railways?

I am looking for logging - who have done editing and where is the ability to return earlier versions of the record.

My guess is that instead of updating or deleting you will use ActiveRecord callback, and instead of updating / deleting the record you create a new one and to keep the same "archive" You can create identifiers, perhaps to find an area to know which record is current, and there is a version field.

I have some plugins but I can not find them at the moment. R

(Is there a word in which I do not know?)

actions_as_audited Go through discussion discussions at the bottom of the post on the page, explains everything you can use even with the act_as_versioned wins below the hand. Developers have posted on issues and received positive feedback from the author and others.

I have used this plugin in many apps and I find it very useful. Highly Recommended.

Here is a preview of the plug-in page:

acts_as_audited is an active record plugin that logs all the modifications to your model in the audit table. It uses a multipurpose association to store audit records for any model objects that you want to audit. The audit log changes the model in which the change was on, "action" (creating, updating, destroying), a serialized hash of changes and alternatively the user took action.


Comments