Sha256: ead6beaf6e9cb220b40efece63cb48e6c8549c93ab1887a8e3da3d5bb81dcb12
Contents?: true
Size: 750 Bytes
Versions: 41
Compression:
Stored size: 750 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" require_dependency "paper_trail/frameworks/active_record" module Decidim # 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 module Traceable extend ActiveSupport::Concern included do has_paper_trail delegate :count, to: :versions, prefix: true def last_whodunnit versions.last.try(:whodunnit) end def last_editor Decidim.traceability.version_editor(versions.last) end end end end
Version data entries
41 entries across 41 versions & 1 rubygems