Module Audited::Auditor::ClassMethods
In: lib/audited/auditor.rb

Methods

Included Modules

Audited::Auditor::AuditedInstanceMethods

Classes and Modules

Module Audited::Auditor::ClassMethods::AuditedClassMethods
Module Audited::Auditor::ClassMethods::AuditedInstanceMethods

Public Instance methods

Configuration options

  • only - Only audit the given attributes
  • except - Excludes fields from being saved in the audit log. By default, Audited will audit all but these fields:
      [self.primary_key, inheritance_column, 'lock_version', 'created_at', 'updated_at']
    

    You can add to those by passing one or an array of fields to skip.

      class User < ActiveRecord::Base
        audited except: :password
      end
    
  • require_comment - Ensures that audit_comment is supplied before any create, update or destroy operation.
  • max_audits - Limits the number of stored audits.
  • if - Only audit the model when the given function returns true
  • unless - Only audit the model when the given function returns false
      class User < ActiveRecord::Base
        audited :if => :active?
    
        def active?
          self.status == 'active'
        end
      end
    

[Validate]