Displaying 3 results from an estimated 3 matches for "audittrail".
2006 Jul 26
1
AuditTrail in Rails
Hello there,
I need to build an audit trail system for an application. So far I have
been looking at acts_as_versioned and acts_as_versioned_association
plugins. I am having troubles getting the second one to work.
Any how, do you have any suggestions about how to build a robust audit
trail?
Thanks,
Roland
--
Posted via http://www.ruby-forum.com/.
2006 Sep 15
2
Caching::Sweeper Access to Controller
...ervers''
/usr/lib/ruby/1.8/observer.rb:184:in `each''
/usr/lib/ruby/1.8/observer.rb:184:in `notify_observers''
Here''s my code (the problem is with ''controller'' being nil):
def log(record, event, user = controller.session[:user])
a = AuditTrail.new(:record_id => record.id, :record_type =>
record.type.name,
:event => event, :user_id => user)
a.record_version = record.version if record.respond_to?("version")
a.save!
end
The interesting thing is that it only happens on actions within...
2009 Aug 04
0
Authlogic::How to access current user from within a cache sweeper?
...he
Authlogic equivalent? Thanks for any help.
Here is Chad''s full example:
class AuditSweeper < ActionController::Caching::Sweeper
observe Person
def after_destroy(record)
log(record, "DESTROY" )
end
def log(record, event, user = controller.session[:user])
AuditTrail.create(:record_id => record.id, :record_type =>
record.type.name, :event => event, :user_id => user)
end
end