title: How to implement a subtotal of all orders?
body: <p>The following, renders: <code>Subtotal: P[object Object]</code></p>
  
  <p>It seems that subtotal is returning the promise object instead of th sum of all orders. <code>VARIATION 2</code> also returns a promise.</p>
  
  <p>How should I go about calculating the subtotal of all products?</p>
  
  <pre><code>  // app/controllers/application.js
    import Ember from 'ember';
  
    export default Ember.ObjectController.extend({    
      subtotal: function() {
        // VARIATION 1:
        var productCollectionPromises = this.get('orders').getEach('product');
        var sum = 0;
  
        return Ember.RSVP.all(productCollectionPromises).then(function(productCollections){
          productCollections.forEach(function(product){
            sum += product.get('amountInCents');
          });
  
          return sum;
        });
  
        // VARIATION 2:
        // return this.get('orders').mapBy('product').reduce(function(previousValue, product) {
        //   return previousValue + product.get('amountInCents');
        // }, 0) / 100;
      }.property('orders.@each.total'),
    });
  
    // app/templates/application.hbs
    &lt;br /&gt;&lt;strong&gt;Subtotal:&lt;/strong&gt; ${{subtotal}}
  </code></pre>