Class: ActiveRecord::Base::ThreadIdentityMap::IdMap
- Inherits:
-
Object
- Object
- ActiveRecord::Base::ThreadIdentityMap::IdMap
- Defined in:
- lib/identity_map/cache.rb
Overview
Manages separated object caches for each model
Instance Method Summary collapse
- #for_class(klass) ⇒ Object
-
#initialize ⇒ IdMap
constructor
A new instance of IdMap.
Constructor Details
#initialize ⇒ IdMap
Returns a new instance of IdMap.
33 34 35 |
# File 'lib/identity_map/cache.rb', line 33 def initialize @objects = {} end |
Instance Method Details
#for_class(klass) ⇒ Object
37 38 39 |
# File 'lib/identity_map/cache.rb', line 37 def for_class(klass) @objects[ klass.base_class ] ||= ClassIdMap.new(klass) end |