Class: Sessions::Current
- Inherits:
-
ActiveSupport::CurrentAttributes
- Object
- ActiveSupport::CurrentAttributes
- Sessions::Current
- Defined in:
- lib/sessions/current.rb
Overview
Per-request state, set by Sessions::Middleware and reset automatically by the Rails executor (the middleware sits after ActionDispatch::Executor in the stack, so CurrentAttributes’ executor-driven clear_all covers it).
Why it exists: the omakase adapter records logins from MODEL callbacks (Session#after_create_commit — the only seam that captures 100% of the generated lifecycle, including 8.1’s password-reset destroy_all), and model callbacks have no request. This carries the request reference across that gap. Background jobs and console code simply see nil and the pipeline degrades gracefully (rows parse from their own stored columns).