Sha256: eab0047e7f8dad9b7f0c219336cc9d1f5d28bdcc967909757138c246fc7035d4

Contents?: true

Size: 436 Bytes

Versions: 6

Compression:

Stored size: 436 Bytes

Contents

require 'volt/utils/generic_counting_pool'

# The identity map ensures that there is only one copy of a model
# used on the front end at a time.
class ModelIdentityMap < GenericCountingPool  
  # add extends GenericCountingPool so it can add in a model without
  # a direct lookup.  We use this when we create a model (without an id)
  # then save it and it gets assigned an id.
  def add(id, model)
    @pool[id] = [1, model]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
volt-0.6.5 lib/volt/models/persistors/model_identity_map.rb
volt-0.6.4 lib/volt/models/persistors/model_identity_map.rb
volt-0.6.3 lib/volt/models/persistors/model_identity_map.rb
volt-0.6.2 lib/volt/models/persistors/model_identity_map.rb
volt-0.6.1 lib/volt/models/persistors/model_identity_map.rb
volt-0.6.0 lib/volt/models/persistors/model_identity_map.rb