Sha256: 33475bb8e5b321b336c2bc32d8c288585e80bba19fccd76d33cce0845d1575c2
Contents?: true
Size: 995 Bytes
Versions: 25
Compression:
Stored size: 995 Bytes
Contents
# encoding: utf-8 module Rack module Mongoid module Middleware # This middleware contains the behaviour needed to properly use the # identity map in Rack based applications. This middleware will properly # handle Rails or Rack streaming responses. class IdentityMap # Initialize the new middleware. # # @example Init the middleware. # IdentityMap.new(app) # # @param [ Object ] app The application. # # @since 2.1.0 def initialize(app) @app = app end # Make the request with the provided environment. # # @example Make the request. # identity_map.call(env) # # @param [ Object ] env The environment. # # @return [ Array ] The status, headers, and response. # # @since 2.1.0 def call(env) ::Mongoid.unit_of_work { @app.call(env) } end end end end end
Version data entries
25 entries across 25 versions & 5 rubygems