title: Proper way to set multiple models on route; depending on user authentication?
body: <p>I'm currently working on an Ember app and it is coming along fine but since I am new to MVC applications in general there are a lot of concepts that don't come naturally to me. </p>
  
  <p>I am currently trying to return two models for my index route. I referred to another SO question (<a href="https://stackoverflow.com/questions/20521967/emberjs-how-to-load-multiple-models-on-the-same-route">EmberJS: How to load multiple models on the same route?</a>) for the correct method and it has worked great.</p>
  
  <p>My problem is now that I need to only set one of the two models only if the user is authenticated. I am using ember-simple-auth, and currently this is what I've got:</p>
  
  <pre><code>// app/routes/index.js
  
  import Ember from 'ember';
  
  export default Ember.Route.extend({
    model: function() {
      if (this.get('session.isAuthenticated')) {
        var _this = this;
        this.get('store').find('user', this.get('session.uid')).then(function(user) {
          _this.set('model.entries', user.get('entries'));
        });
      }
  
      return Ember.RSVP.hash({
        newEntry: this.get('store').createRecord('entry', {
          body: 'Write here ...'
        })
      });
    }
  });
  </code></pre>
  
  <p>For some reason, this does not work. After my route is loaded, the model only has the 'newEntry' property and not an 'entries' property, although the promise does get fulfilled (I put console.logs inside to prove it).</p>
  
  <p>What could be happening? And is this the best way to accomplish this? </p>