title: Ember.js current_user - accessing global variable from controller
body: <p>I am baffled by a seemingly simple ember question. I am using <a href="https://github.com/rails-api/active_model_serializers#attributes" rel="nofollow noreferrer">active_model_serializers meta data serialization</a> to serialize my rails current_user method from a rails controller, then extracting and setting that current_user meta json to a global ember variable using <a href="https://stackoverflow.com/questions/14322945/accessing-meta-information-passed-in-a-json-server-response/14357404#14357404">this guy's temporary solution</a>.</p>
  
  <pre><code>App.CustomRESTSerializer = DS.RESTSerializer.extend({
    extractMeta: function(loader, type, json) {
      var meta;
      meta = json[this.configOption(type, 'meta')];
      if (!meta) { return; }
      Ember.set('App.metaData', meta);
      this._super(loader, type, json);
    }
  });
  </code></pre>
  
  <p>All good up until this point. Now I can access the current_user information from the console by typing in App.metaData.current_user and also from handlebars by calling a specific attribute, i.e.:</p>
  
  <pre><code>{{App.metaData.current_user.email}}
  </code></pre>
  
  <p>and that email attribute shows up in the template. The problem comes when I am trying to access that global variable from within an ember controller. It seems so ridiculously easy, but I can't seem to access current_user from within any ember controller. I have tried:</p>
  
  <pre><code>currentUserBinding: 'App.metaData.current_user',
  
  currentUser: function() {
    return App.metaData.current_user;
  }.property(),
  
  Ember.get('App.metaData.current_user')
  </code></pre>
  
  <p>and a few other methods, but can't seem to access it. It's bizarre that I can access current_user so easily from within the console and handlebars with a direct path, but not from within an ember controller. I must be missing something obvious. </p>
  
  <p>Would appreciate any help!</p>