Class: AffiliationId::Middleware::Rails

Inherits:
Object
  • Object
show all
Defined in:
lib/affiliation_id/middleware/rails.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Rails

Returns a new instance of Rails.



8
9
10
# File 'lib/affiliation_id/middleware/rails.rb', line 8

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
# File 'lib/affiliation_id/middleware/rails.rb', line 12

def call(env)
  req = ActionDispatch::Request.new env
  AffiliationId.current_id = req.request_id
  @app.call(env)
end