Class: Signoff::Current

Inherits:
ActiveSupport::CurrentAttributes
  • Object
show all
Defined in:
lib/signoff/current.rb

Overview

Request-scoped context used to attribute transitions when the acting user, IP address or user agent are not passed explicitly to a transition method.

Populate it from a controller (see Signoff::Controller) or manually:

Signoff::Current.set(user: current_user, ip_address: request.remote_ip) do
  report.approve!
end