Module: EgovUtils::HasAuditTrail::AuditTrailMethods
- Defined in:
- lib/egov_utils/has_audit_trail.rb
Class Method Summary collapse
Instance Method Summary collapse
- #clear_current_journal ⇒ Object
- #init_audit_record(user, notes = '') ⇒ Object
-
#journalized_attribute_names ⇒ Object
Returns the names of attributes that are journalized when updating the issue.
Class Method Details
.included(base) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/egov_utils/has_audit_trail.rb', line 37 def self.included(base) base.class_eval do has_many :audit_records, :as => :audited, :dependent => :destroy, :inverse_of => :audited end end |
Instance Method Details
#clear_current_journal ⇒ Object
45 46 47 |
# File 'lib/egov_utils/has_audit_trail.rb', line 45 def clear_current_journal @current_record = nil end |
#init_audit_record(user, notes = '') ⇒ Object
49 50 51 |
# File 'lib/egov_utils/has_audit_trail.rb', line 49 def init_audit_record(user, notes = '') @current_record ||= AuditRecord.new(:audited => self, :user => user, :notes => notes) end |
#journalized_attribute_names ⇒ Object
Returns the names of attributes that are journalized when updating the issue
54 55 56 |
# File 'lib/egov_utils/has_audit_trail.rb', line 54 def journalized_attribute_names self.class.column_names - self.[:non_audited_columns] end |