title: EmberJS promises in controllers
body: <p>I've been trying for hours to figure out why this isn't working, but I just can't seem to find a solution.</p>
  
  <p>I'm trying to get data via REST, do a few things with the data (e.g. filter it) and then return the results.</p>
  
  <p>This works perfectly if I just return the <code>this.store.find('somthing')</code>. As soon as I use <code>then()</code> - everything breaks.</p>
  
  <pre><code>App.SongController = Ember.ObjectController.extend({
  
    first: (function() {
      return this.second();
    }).property('first', '').volatile()
  
  
    second: (function() {
      var promise = Ember.Deferred.create();
      var data = [{ id: 1, name: 'hi' }];
  
      this.store.find('something').then(function (data) {
        // Do something with the data..
  
        // return the data
        promise.resolve(data);
      });
  
      return promise;
    }).property('second')
  
  });
  </code></pre>
  
  <p>Errors in console:</p>
  
  <pre><code>Assertion failed: The value that #each loops over must be an Array. You passed &lt;Ember.Deferred:ember350&gt;
  Uncaught TypeError: Object [object Object] has no method 'addArrayObserver'
  Assertion failed: Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.
  Uncaught Error: You cannot modify child views while in the inBuffer state 
  </code></pre>