title: Ember: store not available in Application.initializer
body: <p>I have implemented an authentication based on <a href="http://log.simplabs.com/post/57702291669/better-authentication-in-ember-js" rel="nofollow">this</a> article </p>
  
  <p>I thus create an <code>App.Session</code> object at application initialization:</p>
  
  <pre><code>    Ember.Application.initializer({
        name: 'session',
  
        initialize: function (container, application) {
          App.Session = Ember.Object.extend({
            init: function () {
              this._super();
              this.set('authToken', $.cookie('auth_token'));
              this.set('authAccountId', $.cookie('auth_accountId'));
              this.set('authAccountLanguage', $.cookie('auth_accountLanguage'));
            },
  
            authAccountIdChanged: function () {
              var authAccountId = this.get('authAccountId');
              $.cookie('auth_accountId', authAccountId);
  
              //Load the actual account record from the server if the authAccountId is set 
              //Used to have for example the full name or other properties of the account
              if (!Ember.isEmpty(authAccountId)) { 
                this.set('authAccount', this.store.find('account', authAccountId));
              }
            }.observes('authAccountId'),
  ...
  </code></pre>
  
  <p>I have an observer on <code>authAccountId</code>; thus each time the <code>accountId</code> (the <code>id</code> of the logged in user) is changed, I want to retrieve all details of that user (full name, preferences, etc.).</p>
  
  <p>Before Ember data version 1.0.0, I was using:</p>
  
  <pre><code>this.set('authAccount', App.Account.find(authAccountId));
  </code></pre>
  
  <p>And this worked. Now I use: <code>this.set('authAccount', this.store.find('account', authAccountId));</code></p>
  
  <p>And I receive the error: <code>Uncaught TypeError: Cannot call method 'find' of undefined</code>. Also in debugger, <code>this.get('store')</code> results in undefined. I have the impression that the store is not available in <code>Application.initializer</code>. Can somebody help resolving this issue ?</p>