Module: Changed::Auditable

Extended by:
ActiveSupport::Concern
Defined in:
lib/changed/auditable.rb

Instance Method Summary collapse

Instance Method Details

#auditObject

Overview

A helper that caches an audit between operations. Once an audit is persisted this method handles the generation of a new audit, thus ensuring that each transaction is audited separately.



11
12
13
14
# File 'lib/changed/auditable.rb', line 11

def audit
  @audit = Audit.new(audited: self) if @audit.nil? || @audit.persisted?
  @audit
end