Class: ActiveRecord::Base::ThreadIdentityMap::IdMap

Inherits:
Object
  • Object
show all
Defined in:
lib/identity_map/cache.rb

Overview

Manages separated object caches for each model

Instance Method Summary collapse

Constructor Details

#initializeIdMap

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