Class: Rails::DataMapper::Middleware::IdentityMap

Inherits:
Object
  • Object
show all
Defined in:
lib/dm-rails/middleware/identity_map.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, name = :default) ⇒ IdentityMap

Returns a new instance of IdentityMap.



6
7
8
9
# File 'lib/dm-rails/middleware/identity_map.rb', line 6

def initialize(app, name = :default)
  @app = app
  @name = name.to_sym
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
# File 'lib/dm-rails/middleware/identity_map.rb', line 11

def call(env)
  ::DataMapper.repository(@name) do
    @app.call(env)
  end
end