DS.Model#toJSON()

toJSON (options) Object Defined in addon/-private/system/model/model.js:400 Use DS.JSONSerializer to get the JSON representation of a record. toJSON takes an optional hash as a parameter, currently supported options are: includeId: true if the record's ID should be included in the JSON representation. Parameters: options Object Returns: Object A JSON representation of the object.

DS.Model#serialize()

serialize (options) Object Defined in addon/-private/system/model/model.js:382 Create a JSON representation of the record, using the serialization strategy of the store's adapter. serialize takes an optional hash as a parameter, currently supported options are: includeId: true if the record's ID should be included in the JSON representation. Parameters: options Object Returns: Object an object whose values are primitive JSON values only

DS.Model#send()

send (name, context) private Defined in addon/-private/system/model/model.js:480 Parameters: name String context Object

DS.Model#save()

save (options) Promise Defined in addon/-private/system/model/model.js:704 Save the record and persist any changes to the record to an external source via the adapter. Example record.set('name', 'Tomster'); record.save().then(function() { // Success callback }, function() { // Error callback }); If you pass an object on the adapterOptions property of the options argument it will be passed to you adapter via the snapshot record.save({ adapterOptions: { subscribe: false } }); app/adapte

DS.Model#rolledBack event

rolledBack Defined in addon/-private/system/model/model.js:472 Fired when the record is rolled back.

DS.Model#rollbackAttributes()

rollbackAttributes Defined in addon/-private/system/model/model.js:671 Available since 1.13.0 If the model hasDirtyAttributes this function will discard any unsaved changes. If the model isNew it will be removed from the store. Example record.get('name'); // 'Untitled Document' record.set('name', 'Doc 1'); record.get('name'); // 'Doc 1' record.rollbackAttributes(); record.get('name'); // 'Untitled Document'

DS.Model#resetAttribute()

resetAttribute Defined in addon/-private/system/model/model.js:1036 Discards any unsaved changes to the given attribute. Example record.get('name'); // 'Untitled Document' record.set('name', 'Doc 1'); record.get('name'); // 'Doc 1' record.resetAttribute('name'); record.get('name'); // 'Untitled Document'

DS.Model#reload()

reloadPromise Defined in addon/-private/system/model/model.js:750 Reload the record from the adapter. This will only work if the record has already finished loading. Example app/routes/model/view.js import Ember from 'ember'; export default Ember.Route.extend({ actions: { reload: function() { this.controller.get('model').reload().then(function(model) { // do something with the reloaded model }); } } }); Returns: Promise a promise that will be resolved

DS.Model#ready event

ready Defined in addon/-private/system/model/model.js:422 Fired when the record is ready to be interacted with, that is either loaded from the server or created locally.

DS.Model#isValid

isValid{Boolean} Defined in addon/-private/system/model/model.js:211 If this property is true the record is in the valid state. A record will be in the valid state when the adapter did not report any server-side validation failures.