No commit activity in last 3 years
No release in over 3 years
Simple and transparent Identity Map implementation for Mongoid
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.3.0
>= 1.0.0
>= 0
>= 2.5.0

Runtime

 Project Readme

Mongoid Identity Map

Deprecated

Mongoid now has its own identity map. This project has been deprecated.

About Build Status

Mongoid Identity Map is a simple and transparent Identity Map implementation for the Mongoid ODM.

Mongoid

Identity Map pattern

Installing

In Gemfile:

gem "mongoid_identity_map"

Using

Identity map is applied automatically to all queries that return a single model.

Clearing the identity map

A rack middleware - MongoidIdentityMap::ClearMiddleware - is provided for clearing the identity map after each request. In a Rails app, this middleware is automatically added to the list of middlewares.

You can also clear the identity map by calling MongoidIdentityMap::IdentityMap.clear.

Current limitations

Currently, it's an all or nothing deal. It is not possible to turn the identiy map on or off on a class (Mongoid::Document) basis.

Identity map is applied only on queries that return a single model. Queries that return a cursor are not affected.