Class: ActiveRecord::IdentityMap::Middleware
- Defined in:
- activerecord/lib/active_record/identity_map.rb
Defined Under Namespace
Classes: Body
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
145 146 147 |
# File 'activerecord/lib/active_record/identity_map.rb', line 145 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
149 150 151 152 153 154 |
# File 'activerecord/lib/active_record/identity_map.rb', line 149 def call(env) enabled = IdentityMap.enabled IdentityMap.enabled = true status, headers, body = @app.call(env) [status, headers, Body.new(body, enabled)] end |