title: Ember.js - Asyncronous call in model find() method
body: <p>I have implemented <code>find()</code> and <code>findAll()</code> methods on my Property model.  Both methods make asynchronous calls to an API.  <code>findAll()</code> is called while connecting the outlets for my home route, and works fine.  <code>find()</code> is called by Ember.js while connecting the outlets for my property route.  Note that <code>find()</code> is not called when navigating to a property route through actions, but is called when you go directly to the route through the URL.</p>
  
  <p>Here is my router:</p>
  
  <pre><code>App.Router = Ember.Router.extend({
      root: Ember.Route.extend({
          showProperty: Ember.Route.transitionTo('property'),
          home: Ember.Route.extend({
              route: '/',
              connectOutlets: function(router) {
                  router.get('applicationController').connectOutlet('home', App.Property.findAll());
              }        
          }),
          property: Ember.Route.extend({
              route: '/property/:property_id',
              connectOutlets: function(router, property) {
                  router.get('applicationController').connectOutlet('property', property);
              }
          }),
      })
  });
  </code></pre>
  
  <p>And here are my <code>findAll()</code> and <code>find()</code> methods:</p>
  
  <pre><code>App.Property.reopenClass({
      find: function(id) {
          var property = {};
          $.getJSON('/api/v1/property/' + id, function(data) {
              property = App.Property.create(data.property);
          });
          return property;
      },
      findAll: function() {
          var properties = [];
          $.getJSON('/api/v1/properties', function(data) {
              data.properties.forEach(function(item) {
                  properties.pushObject(App.Property.create(item));
              });
          });
          return properties;
      }
  });
  </code></pre>
  
  <p>When I go to a route other than index, for example <code>http://app.tld/#/property/1</code>, the route gets rewritten to <code>http://app.tld/#/property/undefined</code>.  Nothing is being passed to the <code>content</code> property of the Property controller.  How can I make asynchronous calls in the <code>find()</code> method?  Unless I am mistaken, asynchronous calls work fine in the <code>findAll()</code> method, which is the source of my confusion.</p>
  
  <p>This question is similar to <a href="https://stackoverflow.com/questions/11244938/deserialize-with-an-async-callback">Deserialize with an async callback</a>, but I'm using the <code>find()</code> method instead of overriding the <code>deserialize()</code> method.</p>
  
  <p>Thanks in advance.</p>