diff --git a/addon/-private/system/store.js b/addon/-private/system/store.js index 5358148d35b..e2922e3553d 100644 --- a/addon/-private/system/store.js +++ b/addon/-private/system/store.js @@ -1178,7 +1178,8 @@ Store = Service.extend({ /** This method makes a request for one record, where the `id` is not known - beforehand (if the `id` is known, use `findRecord` instead). + beforehand (if the `id` is known, use [`findRecord`](#method_findRecord) + instead). This method can be used when it is certain that the server will return a single object for the primary data. @@ -1208,8 +1209,7 @@ Store = Service.extend({ The request is made through the adapters' `queryRecord`: - ```javascript - // app/adapters/user.js + ```app/adapters/user.js import DS from "ember-data"; export default DS.Adapter.extend({ diff --git a/addon/-private/system/store/finders.js b/addon/-private/system/store/finders.js index 97a51f63a0e..3fc2d3fa371 100644 --- a/addon/-private/system/store/finders.js +++ b/addon/-private/system/store/finders.js @@ -39,7 +39,7 @@ export function _find(adapter, store, typeClass, id, internalModel, options) { var payload = normalizeResponseHelper(serializer, store, typeClass, adapterPayload, id, 'findRecord'); assert('Ember Data expected the primary data returned from a `findRecord` response to be an object but instead it found an array.', !Array.isArray(payload.data)); - warn(`You requested a record of type '${typeClass.modelName}' with id '${id}' but the adapter returned a payload with primary data having an id of '${payload.data.id}'. Looks like you want to use store.queryRecord instead http://emberjs.com/api/data/classes/DS.Store.html#method_queryRecord`, payload.data.id === id, { + warn(`You requested a record of type '${typeClass.modelName}' with id '${id}' but the adapter returned a payload with primary data having an id of '${payload.data.id}'. Use 'store.findRecord()' when the requested id is the same as the one returned by the adapter. In other cases use 'store.queryRecord()' instead http://emberjs.com/api/data/classes/DS.Store.html#method_queryRecord`, payload.data.id === id, { id: 'ds.store.findRecord.id-mismatch' });