     for condition in scope._conditions
       @_conditions.push condition
     @_order = scope._order
+    @_populated = false
     
   @method 'fork', (block) ->
     scope = @_class.createWithScope this

    @_bindingsAdded = false
  
  @method 'bind', (trigger, receiver, selector) ->
    @addBindings() unless @_bindingsAdded
    @super trigger, receiver, selector
  
  @method 'unbindAll', (receiver) ->
    @super receiver
    @removeBindings() if @_bindingsAdded && !@isBound()
  
  @method 'each', (yield) ->
    self = this
    yield = ST.toProc yield
  
    candidates = null
    for condition in @_conditions
      if condition.index
        return unless condition.index.length
        candidates = condition.index.find condition.value
    
    candidates ||= @_model._byUuid
    matches = []
    
    for uuid of candidates
      if candidates.hasOwnProperty uuid
        candidate = candidates[uuid]
        if candidate.matches @_conditions
          if @_order
            matches.push candidate
          else
            yield candidate
    
    if @_order
      matches.sort (a, b) ->
        a_value = a.get self._order
        b_value = b.get self._order
        if a_value > b_value
          1
        else if a_value < b_value
          -1
        else
          0
      for match in matches
        yield match
  
  @method 'count', ->
    count = 0
    @each (item) ->
      count++
    count
  
  @method 'destroyAll', ->
    @each 'destroy'

    @_model.createWithData defaults
  
  @method 'itemAdded', (index, item) ->
    @add item if item.matches @_conditions

  @method 'itemRemoved', (index, item) ->  
    @remove item if item.destroyed || !item.matches(@_conditions)
  
  @method 'itemChanged', (index, item) ->
    @trigger 'itemChanged', item if item.matches @_conditions