You can tell if a record has outstanding changes that have not yet been
saved by checking its
hasDirtyAttributes
property. You can also see what parts of
the record were changed and what the original value was using the
changedAttributes()
method. changedAttributes returns an object, whose keys are the changed
properties and values are an array of values [oldValue, newValue].

At this point, you can either persist your changes via save() or you can roll
back your changes. Calling
rollbackAttributes()
for a saved record reverts all the changedAttributes to their original value.
If the record isNew it will be removed from the store.

Handling Validation Errors

If the backend server returns validation errors after trying to save, they will
be available on the errors property of your model. Here's how you might display
the errors from saving a blog post in your template:

Deleting Records

Deleting records is as straightforward as creating records. Call deleteRecord()
on any instance of DS.Model. This flags the record as isDeleted. The
deletion can then be persisted using save(). Alternatively, you can use
the destroyRecord method to delete and persist at the same time.