Module: Changed::Auditable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/changed/auditable.rb
Instance Method Summary collapse
-
#audit ⇒ Object
Overview.
Instance Method Details
#audit ⇒ Object
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 |