Module: AuditTrail::Model

Extended by:
ActiveSupport::Concern
Defined in:
lib/audit_trail/model.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#change_typeObject



26
27
28
# File 'lib/audit_trail/model.rb', line 26

def change_type
  @change_type ||= changed_object.class.audit_trail_types[changed_attribute.to_s]
end

#previous_valueObject



22
23
24
# File 'lib/audit_trail/model.rb', line 22

def previous_value
  send("previous_#{change_type}_value")
end

#valueObject



18
19
20
# File 'lib/audit_trail/model.rb', line 18

def value
  send("#{change_type}_value")
end