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?