Module: Dynamoid::IdentityMap
- Extended by:
- ActiveSupport::Concern
- Included in:
- Components
- Defined in:
- lib/dynamoid/identity_map.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.clear ⇒ Object
7 8 9 |
# File 'lib/dynamoid/identity_map.rb', line 7 def self.clear Dynamoid.included_models.each { |m| m.identity_map.clear } end |
Instance Method Details
#delete ⇒ Object
72 73 74 75 76 77 |
# File 'lib/dynamoid/identity_map.rb', line 72 def delete return super if self.class.identity_map_off? identity_map.delete(identity_map_key) super end |
#identity_map ⇒ Object
59 60 61 |
# File 'lib/dynamoid/identity_map.rb', line 59 def identity_map self.class.identity_map end |
#identity_map_key ⇒ Object
79 80 81 82 83 |
# File 'lib/dynamoid/identity_map.rb', line 79 def identity_map_key key = hash_key.to_s key += "::#{range_value}" if self.class.range_key key end |
#save(*args) ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/dynamoid/identity_map.rb', line 63 def save(*args) return super if self.class.identity_map_off? if result = super identity_map[identity_map_key] = self end result end |