Creating log of changes to active record objects

Hi,

My client wants something to track actions on objects. For instance, if
one of his employees makes an edit to the system, he wants a log of what
happened. I started adding the after_create, after_update,
after_destroy observer callbacks to the objects that he wants this for.
They create a ‘sitetransaction’ object (I use the term transaction
loosly, because this isn’t the same as a database transaction) which
will log what object was created/updated/deleted, who do this, and when.
Pretty simple stuff.

The issue is with the “who did this” part. I have the user name stored
in a session variable. I can’t access the session data in the model.
Any thoughts on how I can access the session data, or how I can
accomplish this in a better way?

Regards,
Kevin

Perhaps you’re looking for something like acts_as_audited?

On Dec 21, 2007 1:58 AM, Kevin T.
[email protected]
wrote:

Pretty simple stuff.


Ryan B.
http://www.frozenplague.net

That’s exactly what I need. Thanks for the link!

Ryan B. wrote:

Perhaps you’re looking for something like acts_as_audited?

On Dec 21, 2007 1:58 AM, Kevin T.
[email protected]
wrote:

Pretty simple stuff.


Ryan B.
http://www.frozenplague.net

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