Sha256: 6fca3b3e7c11ddf9bb990360ebbad8549338fd540357c746da9056eceb439a01

Contents?: true

Size: 317 Bytes

Versions: 6

Compression:

Stored size: 317 Bytes

Contents

# To use this, add the following line in environment.rb
# config.middleware.use 'PerRequestIdentityMap'
class PerRequestIdentityMap
  def initialize(app)
    @app = app
  end

  def call(env)
    MongoMapper::Plugins::IdentityMap.clear
    @app.call(env)
  ensure
    MongoMapper::Plugins::IdentityMap.clear
  end
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
jonbell-mongo_mapper-0.8.6 examples/identity_map/middleware.rb
ssherman-mongo_mapper-0.8.6 examples/identity_map/middleware.rb
mongo_mapper-0.8.6 examples/identity_map/middleware.rb
mongo_mapper-0.8.5 examples/identity_map/middleware.rb
honkster-mongo_mapper-0.8.4 examples/identity_map/middleware.rb
mongo_mapper-0.8.4 examples/identity_map/middleware.rb