Class: AuditSweeper

Inherits:
ActionController::Caching::Sweeper
  • Object
show all
Defined in:
lib/acts_as_audited_rails3/audit_sweeper.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#before_create(audit) ⇒ Object



24
25
26
# File 'lib/acts_as_audited_rails3/audit_sweeper.rb', line 24

def before_create(audit)
  audit.user ||= current_user
end

#current_userObject



28
29
30
# File 'lib/acts_as_audited_rails3/audit_sweeper.rb', line 28

def current_user
  controller.send :current_user if controller.respond_to?(:current_user, true)
end