Skip to content

Instantly share code, notes, and snippets.

@levity
Created December 7, 2010 01:22
Show Gist options
  • Save levity/731317 to your computer and use it in GitHub Desktop.
Save levity/731317 to your computer and use it in GitHub Desktop.
DataMapper Identity Map on Rack
## 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
@levity
Copy link
Author

levity commented Dec 7, 2010

thx #datamapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment