Class: MassiveRecord::ORM::IdentityMap::Middleware
- Inherits:
-
Object
- Object
- MassiveRecord::ORM::IdentityMap::Middleware
- Defined in:
- lib/massive_record/orm/identity_map.rb
Defined Under Namespace
Classes: BodyProxy
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.
242 243 244 |
# File 'lib/massive_record/orm/identity_map.rb', line 242 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
246 247 248 249 250 251 252 |
# File 'lib/massive_record/orm/identity_map.rb', line 246 def call(env) original_identity_map_state = IdentityMap.enabled? IdentityMap.enabled = true status, headers, body = @app.call(env) [status, headers, BodyProxy.new(body, original_identity_map_state)] end |