Module: ActsAsAuditable::ClassMethods

Defined in:
lib/appstats/acts_as_auditable.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_auditable(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/appstats/acts_as_auditable.rb', line 9

def acts_as_auditable(options = {})
  self.cattr_accessor :auditable_options

  class_eval <<-EOV
     include ActsAsAuditable::InstanceMethods
  
     after_create :audit_create
     after_destroy :audit_destroy
     after_update :audit_update
  EOV
  
  acts_as_auditable_options(options)
end

#acts_as_auditable_options(options = {}) ⇒ Object



23
24
25
# File 'lib/appstats/acts_as_auditable.rb', line 23

def acts_as_auditable_options(options = {})
  self.auditable_options = options
end