Skip to content

Commit

Permalink
[DOC release] Update misleading example for Adapter.queryRecord()
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroicEric committed Jul 30, 2015
1 parent 258bb28 commit d546b22
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/ember-data/lib/system/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,13 @@ var Adapter = Ember.Object.extend({
Example
```javascript
App.ApplicationAdapter = DS.Adapter.extend({
queryRecord: function(store, typeClass, query) {
var url = [type.typeKey, id].join('/');
```app/adapters/application.js
import DS from 'ember-data';
import Ember from 'ember';
export default DS.Adapter.extend(DS.BuildURLMixin, {
queryRecord: function(store, type, query) {
var url = this.buildURL(type.modelName, null, null, 'queryRecord', query);
return new Ember.RSVP.Promise(function(resolve, reject) {
Ember.$.getJSON(url, query).then(function(data) {
Expand All @@ -220,7 +223,6 @@ var Adapter = Ember.Object.extend({
@param {DS.Store} store
@param {subclass of DS.Model} type
@param {Object} query
@param {String} id
@return {Promise} promise
*/
queryRecord: null,
Expand Down

0 comments on commit d546b22

Please sign in to comment.