title: How to get a value from a promise in EmberJS with custom Adapter
body: <p>I am pretty new to EmberJS, I am trying to get back a value from a promise given by a custom adapter since the backend is not rails API compliant </p>
  
  <p>Here is my custom adapter: </p>
  
  <pre><code>import DS from 'ember-data';
  import Ember from 'ember';
  
      export default DS.Adapter.extend({
        findRecord( store, type, id ) {
          return Ember.$.getJSON("http://localhost:8000/user/by-username/" + id );
  
    }
  });
  </code></pre>
  
  <p>I also modified my serializer: </p>
  
  <pre><code>import DS from 'ember-data';
  
  export default DS.JSONSerializer.extend({
    primaryKey:'alias',
  });
  </code></pre>
  
  <p>my controller looks like this (where I am stuck):</p>
  
  <pre><code>import Ember from 'ember';
  
  export default Ember.Controller.extend({
    username:'',
    actions: {
      searchUser : function(){
        var id = this.get('username');
        var promise = this.get('store').findRecord('roles', id);
        var self = this
        promise.then(function(value) {
          self.set('username', value.get('ID'));
        }, function(reason) {
          // on rejection
        });
  
  
      }
    }
  });
  </code></pre>
  
  <p>Specifically on this line from above controller, I can not get it to work: </p>
  
  <pre><code>self.set('username', value.get('ID'));
  </code></pre>
  
  <p>The ajax is exectued succesfully since I can see it happen on chrome dev tools returning json following data: </p>
  
  <pre><code>{"ID":"73ebf44f-71bf-4b60-a755-a4bbef208ef1","mjID":34049137,"alias":"coderman","registration_date":"2017-07-07T20:03:11Z"}
  </code></pre>
  
  <p>I am not able to get the ID value to be set to the username property</p>