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.8.24 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.23 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.22 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.22.beta2 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.22.beta1 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.21 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.20 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.19 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.18 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.17 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.16 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.15 lib/volt/models/persistors/model_identity_map.rb