Class: Sixty::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/sixty/railtie.rb

Overview

Rails wiring.

The whole install is gem 'sixty' plus a key in the environment. Everything below happens on boot, in the order the framework allows it: the middleware goes on the stack, the query subscriber attaches once ActiveRecord is loaded, and controllers are wrapped through on_load so this file never forces a constant into existence that the application had not asked for.

── Where the middleware sits, and why it matters ─────────────────────────

Second from the top, after ActionDispatch::RequestId, so the span covers essentially the whole request — including the time other middleware spends, which is where a surprising amount of a slow request lives (a session store doing a database read, a rate limiter calling Redis). Inserting it lower would make every one of those invisible and quietly attribute their time to the controller.