Class: Decidim::Plans::Tracer

Inherits:
Object
  • Object
show all
Defined in:
app/services/decidim/plans/tracer.rb

Overview

The Tracer class allows performing PaperTrail requests where all records saved during the yield will be stored against the same transaction ID. This allows saving the main record and its associated records so that the same changeset can be easily identified afterwards.

Instance Method Summary collapse

Instance Method Details

#trace!(author) ⇒ Object



10
11
12
13
14
15
16
# File 'app/services/decidim/plans/tracer.rb', line 10

def trace!(author)
  return unless block_given?

  ::PaperTrail.request(whodunnit: gid(author)) do
    yield
  end
end