Module: Croesus::IdentityMap::ClassMethods
- Defined in:
- lib/croesus/identity_map.rb
Instance Method Summary collapse
Instance Method Details
#get(id, options = nil) ⇒ Object
64 65 66 |
# File 'lib/croesus/identity_map.rb', line 64 def get(id, = nil) get_from_identity_map(id) || super end |
#load(id, attrs) ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/croesus/identity_map.rb', line 73 def load(id, attrs) if IdentityMap.enabled? && instance = IdentityMap.repository[id] instance else super.tap { |doc| doc.add_to_identity_map } end end |