     class BookStore extends Backbone.Model
       model_name: 'BookStore'
       schema:
+        id: [manual: true]
         books: ['hasMany', Book]
         authors: ['hasMany', Author]
       sync: BackboneORM.sync(BookStore)

    class Book extends Backbone.Model
      model_name: 'Book'
      schema:
        author: -> ['belongsTo', Author]
      sync: BackboneORM.sync(Book)


      authors:[{name: 'fred', _id: "a1"}, {name: 'ted', _id: "a2"}]
    })

    queue = new Queue(1)
    for model in bs.get('authors').models
      do (model) -> queue.defer (callback) -> model.save(callback)
    for model in bs.get('books').models
      do (model) -> queue.defer (callback) -> model.fetchRelated(callback)
    queue.await (err) ->
      return done(err) if err

      BookViewModel = kb.ViewModel.extend({
        constructor: (model) ->
          kb.ViewModel.prototype.constructor.apply(this, arguments)
          this.editMode = ko.observable()

          @edit = =>
            model._save = model.toJSON()
            @editMode(true)

          @confirm = =>
            model._save = null
            @editMode(false)

          @cancel = =>
            model.set(model._save)
            @editMode(false)
          @
      })

      view_model = {
        books: kb.collectionObservable(bs.get('books'), {
          factories:
            models: BookViewModel
            'models.author.books.models': BookViewModel
        })
      }

      for book in view_model.books()
        author = book.author()
        for authored_book in author.books()
          authored_book.editMode(true)
          assert.equal(authored_book.editMode(), true, 'edit mode set')
      done()

  it '6. Inferring observable types: from the start', (done) ->
    kb.statistics = new kb.Statistics() # turn on stats
