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



31
32
33
34
# File 'lib/acts_as_audited/audit_sweeper.rb', line 31

def before_create(audit)
  raise "Got here"
  audit.send("#{CollectiveIdea::Acts::Audited.human_model}=".to_sym, current_user) unless audit.send(CollectiveIdea::Acts::Audited.human_model)
end

#current_userObject



36
37
38
# File 'lib/acts_as_audited/audit_sweeper.rb', line 36

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

#current_user_methodObject



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

def current_user_method
  "current_#{CollectiveIdea::Acts::Audited.human_model}".to_sym
end