Class: ActiveRecord::IdentityMap::Middleware
- Inherits:
-
Object
- Object
- ActiveRecord::IdentityMap::Middleware
- Defined in:
- 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.
150 151 152 |
# File 'lib/active_record/identity_map.rb', line 150 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
154 155 156 157 158 159 |
# File 'lib/active_record/identity_map.rb', line 154 def call(env) enabled = IdentityMap.enabled IdentityMap.enabled = true status, headers, body = @app.call(env) [status, headers, Body.new(body, enabled)] end |