Sha256: 243e5e5892d75f33c36a96665159ee93f4a7e95f0a571f088d0a272c2ce4ea82

Contents?: true

Size: 435 Bytes

Versions: 37

Compression:

Stored size: 435 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

37 entries across 37 versions & 1 rubygems

Version Path
volt-0.8.14 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.13 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.11 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.10 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.9 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.8 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.7 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.6 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.5 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.4 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.3 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.2 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.1 lib/volt/models/persistors/model_identity_map.rb
volt-0.8.0 lib/volt/models/persistors/model_identity_map.rb
volt-0.7.23 lib/volt/models/persistors/model_identity_map.rb
volt-0.7.22 lib/volt/models/persistors/model_identity_map.rb
volt-0.7.21 lib/volt/models/persistors/model_identity_map.rb
volt-0.7.20 lib/volt/models/persistors/model_identity_map.rb
volt-0.7.19 lib/volt/models/persistors/model_identity_map.rb
volt-0.7.18 lib/volt/models/persistors/model_identity_map.rb