Created
December 7, 2010 01:22
-
-
Save levity/731317 to your computer and use it in GitHub Desktop.
DataMapper Identity Map on Rack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## somewhere | |
module Persistence | |
class IdentityMap | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
DataMapper.repository { @app.call(env) } | |
end | |
end | |
end | |
## config.ru | |
use Persistence::IdentityMap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thx #datamapper