Module: CollectiveIdea::ActionController::Audited

Defined in:
lib/acts_as_audited_rails3/audit_sweeper.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#audit(*models) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/acts_as_audited_rails3/audit_sweeper.rb', line 4

def audit(*models)
  ActiveSupport::Deprecation.warn("#audit is deprecated. Declare #acts_as_audited in your models.", caller)
  
  options = models.extract_options!

  # Parse the options hash looking for classes
  options.each_key do |key|
    models << [key, options.delete(key)] if key.is_a?(Class)
  end

  models.each do |(model, model_options)|
    model.send :acts_as_audited, model_options || {}
  end
end