DS.Adapter#findRecord()

findRecord (store, type, id, snapshot) Promise Defined in addon/adapter.js:88 The findRecord() method is invoked when the store is asked for a record that has not previously been loaded. In response to findRecord() being called, you should query your persistence layer for a record with the given ID. The findRecord method should return a promise that will resolve to a JavaScript object that will be normalized by the serializer. Here is an example findRecord implementation: app/adapters/appli

DS.Adapter#findMany()

findMany (store, type, ids, snapshots) Promise Defined in addon/adapter.js:423 The store will call findMany instead of multiple findRecord requests to find multiple records at once if coalesceFindRequests is true. app/adapters/application.js import DS from 'ember-data'; export default DS.Adapter.extend({ findMany(store, type, ids, snapshots) { return new Ember.RSVP.Promise(function(resolve, reject) { Ember.$.ajax({ type: 'GET', url: `/${type.modelName}/`,

DS.Adapter#findAll()

findAll (store, type, sinceToken, snapshotRecordArray) Promise Defined in addon/adapter.js:123 The findAll() method is used to retrieve all records for a given type. Example app/adapters/application.js import DS from 'ember-data'; export default DS.Adapter.extend({ findAll: function(store, type, sinceToken) { var query = { since: sinceToken }; return new Ember.RSVP.Promise(function(resolve, reject) { Ember.$.getJSON(`/${type.modelName}`, query).then(function(data) {

DS.Adapter#deleteRecord()

deleteRecord (store, type, snapshot) Promise Defined in addon/adapter.js:371 Implement this method in a subclass to handle the deletion of a record. Sends a delete request for the record to the server. Example app/adapters/application.js import DS from 'ember-data'; export default DS.Adapter.extend({ deleteRecord: function(store, type, snapshot) { var data = this.serialize(snapshot, { includeId: true }); var id = snapshot.id; return new Ember.RSVP.Promise(function(resolve, r

DS.Adapter#defaultSerializer

defaultSerializer{String} Defined in addon/adapter.js:66 If you would like your adapter to use a custom serializer you can set the defaultSerializer property to be the name of the custom serializer. Note the defaultSerializer serializer has a lower priority than a model specific serializer (i.e. PostSerializer) or the application serializer. app/adapters/django.js import DS from 'ember-data'; export default DS.Adapter.extend({ defaultSerializer: 'django' });

DS.Adapter#createRecord()

createRecord (store, type, snapshot) Promise Defined in addon/adapter.js:282 Implement this method in a subclass to handle the creation of new records. Serializes the record and sends it to the server. Example app/adapters/application.js import DS from 'ember-data'; export default DS.Adapter.extend({ createRecord: function(store, type, snapshot) { var data = this.serialize(snapshot, { includeId: true }); return new Ember.RSVP.Promise(function(resolve, reject) { Ember.$.aja

DS.Adapter#coalesceFindRequests

coalesceFindRequests{boolean} Defined in addon/adapter.js:412 By default the store will try to coalesce all fetchRecord calls within the same runloop into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call. You can opt out of this behaviour by either not implementing the findMany hook or by setting coalesceFindRequests to false.

DS.Adapter

DS.Adapter Class Extends: Ember.Object Defined in: addon/adapter.js:8 Module: ember-data An adapter is an object that receives requests from a store and translates them into the appropriate action to take against your persistence layer. The persistence layer is usually an HTTP API, but may be anything, such as the browser's local storage. Typically the adapter is not invoked directly instead its functionality is accessed through the store. Creating an Adapter Create a new subclass of DS.Ad

DS.AbortError

DS.AbortError Class Defined in: addon/adapters/errors.js:126 Module: ember-data

DS#normalizeModelName()

normalizeModelName (modelName) Stringpublic Defined in addon/-private/system/normalize-model-name.js:6 This method normalizes a modelName into the format Ember Data uses internally. Parameters: modelName String Returns: String normalizedModelName