module Decidim::Traceable

A concern that adds traceabilty capability to the given model. Including this allows you the keep track of changes in the model attributes and changes authorship.

Example:

class MyModel < ApplicationRecord
  include Decidim::Traceable
end

Public Instance Methods

last_editor() click to toggle source
# File lib/decidim/traceable.rb, line 28
def last_editor
  Decidim.traceability.version_editor(versions.last)
end
last_whodunnit() click to toggle source
# File lib/decidim/traceable.rb, line 24
def last_whodunnit
  versions.last.try(:whodunnit)
end