Class DS.Model

The model class that all Ember Data records descend from.
This is the public API of Ember Data models. If you are using Ember Data
in your application, this is the class you should use.
If you are working on Ember Data internals, you most likely want to be dealing
with InternalModel

changedAttributesObject

an object, whose keys are changed properties,
and value is an [oldProp, newProp] array.

Returns an object, whose keys are changed properties, and value is
an [oldProp, newProp] array.

The array represents the diff of the canonical state with the local state
of the model. Note: if the model is created locally, the canonical state is
empty since the adapter hasn't acknowledged the attributes yet:

deleteRecord

Marks the record as deleted but does not save it. You must call
save afterwards if you want to persist it. You might use this
method if you want to allow the user to still rollbackAttributes()
after a delete was made.

didDefineProperty
(proto, key, value)

This Ember.js hook allows an object to be notified when a property
is defined.

In this case, we use it to be notified when an Ember Data user defines a
belongs-to relationship. In that case, we need to set up observers for
each one, allowing us to track relationship changes and automatically
reflect changes in the inverse has-many array.

This hook passes the class being set up, as well as the key and value
being defined. So, for example, when the user does this:

1
2
3

DS.Model.extend({
parent: DS.belongsTo('user')
});

This hook would be called with "parent" as the key and the computed
property returned by DS.belongsTo as the value.

eachRelatedType
(callback, binding)

Given a callback, iterates over each of the types related to a model,
invoking the callback with the related type's class. Each type will be
returned just once, regardless of how many different relationships it has
with a model.