           product_id:3
         }]
 
-    class @ProductVariant extends Batman.Model
+    namespace.ProductVariant = class @ProductVariant extends Batman.Model
       @encode 'price'
       @belongsTo 'product', namespace: namespace
 

  @Store.find 1, (err, store) =>
    source = '<div><span data-foreach-product="store.products" data-bind="product.name"></span></div>'
    context = Batman(store: store)
    helpers.render source, context, (node) =>
      equal node.children().get(0).innerHTML, 'Product One'
      equal node.children().get(1).innerHTML, 'Product Two'
      equal node.children().get(2).innerHTML, 'Product Three'

      addedProduct = new @Product(name: 'Product Four', store_id: store.id)
      addedProduct.save (err, savedProduct) ->

        name: "Store One"
        id: 1

    namespace.Product = class @Product extends Batman.Model
      @encode 'id', 'name', 'store_id'
      @belongsTo 'store', namespace: namespace
      @hasMany 'productVariants', namespace: namespace
