Sha256: 0551ddb3ddaecf174fe5923d69e05a6b93ab88d8dfa9dcb9e7aaf75ef31fd449

Contents?: true

Size: 471 Bytes

Versions: 72

Compression:

Stored size: 471 Bytes

Contents

require 'volt/utils/generic_counting_pool'

module Volt
  # 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
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
volt-0.9.7.pre8 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.7.pre7 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.7.pre6 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.7.pre5 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.7.pre3 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.7.pre2 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.6 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.6.pre3 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.6.pre2 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.6.pre1 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre12 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre11 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre9 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre8 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre7 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre6 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre5 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre4 lib/volt/models/persistors/model_identity_map.rb
volt-0.9.5.pre3 lib/volt/models/persistors/model_identity_map.rb