On 7/25/05, PaulCheeBinChin
<PaulCheeBin.Chin-WVx2IYneKhdQ9++HdZ7WsQ@public.gmane.org>
wrote:>
> Hi all, I want to implement audit tables for all my tables, When changes /
> deletion made to a particular record, I want to save all data in the record
> (prior update) to somewhere. What is the best way to implement it.
>
> I thinking along the line of having correspondenting audit table to every
> table, that will save the data prior to update / delete to the audit
table.
I''ve written an extension to ActiveRecord for this functionality.
Basically, just add acts_as_versioned to your model, and it does just
that. You do have to create the table for it, but there is a simple
method suitable for Migrations that will do all that for you.
If you''re comfortable working with SVN patches, I have the latest on a
research ticket: http://dev.rubyonrails.org/ticket/1758. I would
really appreciate any feedback on it.
--
rick
http://techno-weenie.net