Class: AuditSweeper

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#before_create(audit) ⇒ Object



23
24
25
# File 'lib/acts_as_audited/audit_sweeper.rb', line 23

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

#current_userObject



27
28
29
# File 'lib/acts_as_audited/audit_sweeper.rb', line 27

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