Forum: Ruby on Rails Logging stuff

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
aa a. (Guest)
on 2009-02-03 00:53
Say I wanted to log all successful and failed saves to a special log
table. But I also wanted to save the logged in user and some other
session stuff.
I assume I would have some sort of module included into the controllers,
which would then do something with the methods of the objects being
manipulated, but I'm not sure what the best approach is. I've tried a
few variations of alias_method, but I'm struggling to get the
information from the controller across to the context of the model.
Does the answer involve binding perhaps?
Ryan B. (Guest)
on 2009-02-03 01:38
(Received via mailing list)
Use acts_as_audited.
Philip H. (Guest)
on 2009-02-03 01:38
(Received via mailing list)
> Say I wanted to log all successful and failed saves to a special log
> table. But I also wanted to save the logged in user and some other
> session stuff.
> I assume I would have some sort of module included into the
> controllers,
> which would then do something with the methods of the objects being
> manipulated, but I'm not sure what the best approach is. I've tried a
> few variations of alias_method, but I'm struggling to get the
> information from the controller across to the context of the model.
> Does the answer involve binding perhaps?

This is what I did on a recent project...

http://pjkh.com/articles/2009/02/02/creating-an-au...

-philip
This topic is locked and can not be replied to.